[clang] [Clang] Reset ArgPackSubstIndex before rewriting CTAD template parameters (PR #141741)
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed May 28 07:09:21 PDT 2025
================
@@ -1099,6 +1099,10 @@ BuildDeductionGuideForTypeAlias(Sema &SemaRef,
// parameters, used for building `TemplateArgsForBuildingFPrime`.
SmallVector<TemplateArgument, 16> TransformedDeducedAliasArgs(
AliasTemplate->getTemplateParameters()->size());
+ // We might be already within a pack expansion, but rewriting template
+ // parameters is independent of that. (We may or may not expand new packs
+ // when rewriting. So clear the state)
+ Sema::ArgPackSubstIndexRAII _(SemaRef, std::nullopt);
----------------
erichkeane wrote:
```suggestion
Sema::ArgPackSubstIndexRAII PackSubstReset(SemaRef, std::nullopt);
```
https://github.com/llvm/llvm-project/pull/141741
More information about the cfe-commits
mailing list