================
@@ -402,6 +402,19 @@ bool Sema::DiagnoseUnexpandedParameterPack(Expr *E,
   if (!E->containsUnexpandedParameterPack())
     return false;
 
+  // Exception: The `CollectUnexpandedParameterPacksVisitor` collects nothing
+  // from a FunctionParmPackExpr. In the context where the collector is being
+  // used such as `collectUnexpandedParameterPacks`, this type of expression
+  // is not expected to be collected.
+  //
+  // Nonetheless, this function for diagnosis is still called anyway during
+  // template instantiation, with an expression of such a type if we're inside 
a
+  // lambda with unexpanded parameters.
+  //
+  // Rule out this case to prevent the assertion failure.
----------------
AaronBallman wrote:

```suggestion
  // CollectUnexpandedParameterPacksVisitor does not expect to see a 
FunctionParmPackExpr, but
  // diagnosing unexpected parameter packs may still see such an expression in 
a lambda body. We'll
  // bail out early in this case to avoid triggering an assertion.
```
Slight rewording.

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

Reply via email to