================ @@ -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), ---------------- erichkeane wrote:
This trickery with storing the ASTContext seems a little silly. I would vastly prefer one of the following: 1- We just store the AST Context reference in this type. 2- We make `getInjectedTemplateArgs` take an `ASTContext` reference. 3- We take a collection in `getInjectedTemplateArgs` and just fill it. 4- We DON'T have this function (or do #2), and keep the `ASTContext` version of this function to do the work. 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