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

Krystian Stasiowski via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 29 08:18:45 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),
----------------
sdkrystian wrote:

> Is it REALLY troublesome/not really possible, or is it just a code change?

Fixing existing code should be trivial, I just really dislike "getters" with parameters :P Ultimately, the "right thing" here is very subjective... but I'll cherry-pick [3fd8326](https://github.com/llvm/llvm-project/commit/3fd8326e222877bce474010481a459b5db0c8be2) onto this branch & merge, absent any objections

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


More information about the cfe-commits mailing list