[clang] [Clang][AST] Store injected template arguments in TemplateParameterList (PR #113579)

Erich Keane via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 25 11:05:55 PDT 2024


================
@@ -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:

Yep, i understand that.  Currying is always pretty awkward in languages/programs that don't otherwise lazily evaluate :)  It seems to me if the callers to this all have access to ASTContext, we could more easily just require it as a caller-passed arg.

https://github.com/llvm/llvm-project/pull/113579


More information about the cfe-commits mailing list