================ @@ -51,14 +51,15 @@ DefaultTemplateArgumentContainsUnexpandedPack(const TemplateParam &P) { P.getDefaultArgument().getArgument().containsUnexpandedParameterPack(); } -TemplateParameterList::TemplateParameterList(const ASTContext& C, +TemplateParameterList::TemplateParameterList(const ASTContext &C, SourceLocation TemplateLoc, SourceLocation LAngleLoc, ArrayRef<NamedDecl *> Params, SourceLocation RAngleLoc, Expr *RequiresClause) - : TemplateLoc(TemplateLoc), LAngleLoc(LAngleLoc), RAngleLoc(RAngleLoc), - NumParams(Params.size()), ContainsUnexpandedParameterPack(false), + : InjectedArgs(&C), TemplateLoc(TemplateLoc), LAngleLoc(LAngleLoc), ---------------- sdkrystian wrote:
> This trickery with storing the ASTContext seems a little silly. @erichkeane Is there any particular reason why? We already do something similar in e.g. `Redeclarable::DeclLink`. The injected template arguments are lazily allocated & cached, so we don't need the pointer to `ASTContext` once the injected template arguments have been allocated. Since we _can_ use a `PointerUnion` to store both values, I think adding yet another pointer to `TemplateParameterList` would be rather unjustified. https://github.com/llvm/llvm-project/pull/113579 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits