================
@@ -972,8 +972,30 @@ static const Expr
*SubstituteConstraintExpressionWithoutSatisfaction(
// equivalence.
LocalInstantiationScope ScopeForParameters(S);
if (auto *FD = DeclInfo.getDecl()->getAsFunction())
- for (auto *PVD : FD->parameters())
- ScopeForParameters.InstantiatedLocal(PVD, PVD);
+ for (auto *PVD : FD->parameters()) {
+ if (!PVD->isParameterPack()) {
+ ScopeForParameters.InstantiatedLocal(PVD, PVD);
+ continue;
+ }
+ // This is hacky: we're mapping the parameter pack to a size-of-1
argument
+ // to avoid building SubstTemplateTypeParmPackTypes for
+ // PackExpansionTypes. The SubstTemplateTypeParmPackType node would
+ // otherwise reference the AssociatedDecl of the template arguments,
which
+ // is, in this case, the template declaration.
+ //
+ // However, as we're also calculating the redeclarations of the template,
+ // the canonical declarations thereof are actually themselves at the
----------------
cor3ntin wrote:
```suggestion
// However, as we are in the process of comparing potential
re-declarations,
// the canonical declaration is the declaration itself at this point.
```
https://github.com/llvm/llvm-project/pull/102131
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits