[clang] [Sema] Avoid an undesired pack expansion while transforming PackIndexingType (PR #90195)
via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 26 04:34:10 PDT 2024
================
@@ -6649,6 +6649,9 @@ TreeTransform<Derived>::TransformPackIndexingType(TypeLocBuilder &TLB,
}
}
+ // We may be doing this in the context of expanding the Pattern. Forget that
+ // because it has been handled above.
+ Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(getSema(), -1);
----------------
cor3ntin wrote:
```suggestion
// A pack indexing type can appear in a larger pack expansion,
// e.g `Pack...[pack_of_indexes]...`
// so we need to temporarily disable substitution of pack elements
Sema::ArgumentPackSubstitutionIndexRAII SubstIndex(getSema(), -1);
```
https://github.com/llvm/llvm-project/pull/90195
More information about the cfe-commits
mailing list