================
@@ -2393,9 +2413,13 @@ ExprResult
TemplateInstantiator::TransformFunctionParmPackRefExpr(DeclRefExpr *E,
ValueDecl *PD) {
typedef LocalInstantiationScope::DeclArgumentPack DeclArgumentPack;
- llvm::PointerUnion<Decl *, DeclArgumentPack *> *Found
- = getSema().CurrentInstantiationScope->findInstantiationOf(PD);
- assert(Found && "no instantiation for parameter pack");
+ llvm::PointerUnion<Decl *, DeclArgumentPack *> *Found =
+ getSema().CurrentInstantiationScope->getInstantiationOfIfExists(PD);
+
+ // This can happen when instantiating an expansion statement that contains
+ // a pack (e.g. `template for (auto x : {{ts...}})`).
+ if (!Found)
+ return E;
----------------
zyn0217 wrote:
Why? is it possible to ensure its existence?
https://github.com/llvm/llvm-project/pull/165195
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits