zyn0217 wrote:

Sorry for my late update - I've had a busy week ;)

> I don't think so as they don't have parameter or capture list

+1. and it looks like we don't allow expanding a pack outside a statement 
expression, which more or less prevents the appearance of 
`FunctionParmPackExpr`.

> so i would encouraging researching
> ```cpp
> assert((!Unexpanded.empty() || enclosedInAnOtherExpression()) && "Unable to 
> find unexpanded parameter packs");
> ```
> where enclosedInAnOtherExpression would try to check that we are in a lambda 
> - maybe Sema::getEnclosingLambda() is sufficient - not sure though.

Instead of putting it inside an assertion, how about adding a check for 
FunctionParmPackExpr separately? I mean,
```cpp
if (auto *Expr = dyn_cast<FunctionParmPackExpr>(E); Expr && 
getEnclosingLambda())
  return false;
```
to bail out only inside the `Expr` overload of 
`DiagnoseUnexpandedParameterPack`. (since it's the one being called anyways 
during template instantiation.)


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