================
@@ -323,30 +324,99 @@ struct TemplateParameterListBuilder {
S.Context, Builder.Record->getDeclContext(), SourceLocation(),
SourceLocation(), /* TemplateDepth */ 0, Position,
&S.Context.Idents.get(Name, tok::TokenKind::identifier),
- /* Typename */ false,
- /* ParameterPack */ false);
+ /* Typename */ true,
+ /* ParameterPack */ false,
+ /* HasTypeConstraint*/ false);
if (!DefaultValue.isNull())
Decl->setDefaultArgument(
S.Context, S.getTrivialTemplateArgumentLoc(DefaultValue, QualType(),
SourceLocation()));
-
+ Decl->setReferenced();
----------------
bob80905 wrote:
This is an odd addition that I am not 100% convinced is absolutely necessary,
although I haven't tried testing without it. I don't think it's a bugfix per
se. The reason this line exists is because I am trying to match this AST as
perfectly as possible, and it served as a guide throughout my development
(Thanks to Chris):
https://godbolt.org/z/Gq4hdTcrK
The AST that is constructed in this PR is constructed *as if* the code in the
godbolt link were defined and parsed somewhere, and the code in the link uses
typename and is referenced. So, I set the appropriate decl as referenced, and
make sure it's represented with a typename rather than a class.
https://github.com/llvm/llvm-project/pull/112600
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits