[clang] [Clang] Transform lambda's constraints when instantiating parameter mapping (PR #195995)

Matheus Izvekov via cfe-commits cfe-commits at lists.llvm.org
Thu May 7 10:06:38 PDT 2026


================
@@ -533,12 +533,6 @@ bool Parser::isTypeConstraintAnnotation() {
 bool Parser::TryAnnotateTypeConstraint() {
   if (!getLangOpts().CPlusPlus20)
     return false;
-  // The type constraint may declare template parameters, notably
-  // if it contains a generic lambda, so we need to increment
-  // the template depth as these parameters would not be instantiated
-  // at the current depth.
-  TemplateParameterDepthRAII CurTemplateDepthTracker(TemplateParameterDepth);
-  ++CurTemplateDepthTracker;
----------------
mizvekov wrote:

Yeah, this certainly looked wrong, this is not a place in the grammar you would see an increase in template depth, so props for getting rid of this.

https://github.com/llvm/llvm-project/pull/195995


More information about the cfe-commits mailing list