================
@@ -614,10 +614,14 @@ bool Sema::SetupConstraintScope(
     // reference the original primary template.
     // We walk up the instantiated template chain so that nested lambdas get
     // handled properly.
-    for (FunctionTemplateDecl *FromMemTempl =
-             PrimaryTemplate->getInstantiatedFromMemberTemplate();
-         FromMemTempl;
-         FromMemTempl = FromMemTempl->getInstantiatedFromMemberTemplate()) {
+    // Note that we shall not collect instantiated parameters from
+    // 'intermediate' transformed function templates but the primary template
+    // for which we have built up the template arguments relative to. 
Otherwise,
+    // we may have mismatched template parameter depth!
----------------
cor3ntin wrote:

```suggestion
    // We should only collect instantiated parameters from 
    // the primary template. Otherwise, we may have mismatched template 
parameter depth!
```

https://github.com/llvm/llvm-project/pull/82310
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to