Skip to content

Commit 5fffbe4

Browse files
committed
[clang][ASTDump] Dump value of structural TemplateArguments
`TemplateArgument::ArgKind::StructuralValue` was introduced in #78041 The AST dump for such template arguments would yield the following: ``` |-ClassTemplateSpecializationDecl `- TemplateArgument ``` With this patch we would dump as: ``` |-ClassTemplateSpecializationDecl `-TemplateArgument structural '1.000000e+00' ```
1 parent e258bca commit 5fffbe4

File tree

3 files changed

+685
-671
lines changed

3 files changed

+685
-671
lines changed

clang/include/clang/AST/TextNodeDumper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ class TextNodeDumper
253253
void VisitTemplateExpansionTemplateArgument(const TemplateArgument &TA);
254254
void VisitExpressionTemplateArgument(const TemplateArgument &TA);
255255
void VisitPackTemplateArgument(const TemplateArgument &TA);
256+
void VisitStructuralValueTemplateArgument(const TemplateArgument &TA);
256257

257258
void VisitIfStmt(const IfStmt *Node);
258259
void VisitSwitchStmt(const SwitchStmt *Node);

clang/lib/AST/TextNodeDumper.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1226,6 +1226,11 @@ void TextNodeDumper::VisitIntegralTemplateArgument(const TemplateArgument &TA) {
12261226
dumpTemplateArgument(TA);
12271227
}
12281228

1229+
void TextNodeDumper::VisitStructuralValueTemplateArgument(const TemplateArgument &TA) {
1230+
OS << " structural";
1231+
dumpTemplateArgument(TA);
1232+
}
1233+
12291234
void TextNodeDumper::dumpTemplateName(TemplateName TN, StringRef Label) {
12301235
AddChild(Label, [=] {
12311236
{

0 commit comments

Comments
 (0)