From 604446aa6b41461e2691c9f4253e9ef70a5d68e4 Mon Sep 17 00:00:00 2001 From: David Blaikie Date: Sun, 14 Nov 2021 18:59:41 -0800 Subject: [PATCH] ast-dump: Add missing identation of class template specializations --- clang/lib/AST/DeclPrinter.cpp | 1 + clang/test/AST/ast-dump-templates.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp index 884b8e7..5c6781c 100644 --- a/clang/lib/AST/DeclPrinter.cpp +++ b/clang/lib/AST/DeclPrinter.cpp @@ -1185,6 +1185,7 @@ void DeclPrinter::VisitClassTemplateDecl(ClassTemplateDecl *D) { if (D->isThisDeclarationADefinition()) Out << ";"; Out << "\n"; + Indent(); Visit(I); } } diff --git a/clang/test/AST/ast-dump-templates.cpp b/clang/test/AST/ast-dump-templates.cpp index cb2994e..dcecdca 100644 --- a/clang/test/AST/ast-dump-templates.cpp +++ b/clang/test/AST/ast-dump-templates.cpp @@ -78,7 +78,7 @@ struct foo { // includes the type for the auto argument and omits it for the fixed // type/unsigned argument (see // TemplateParameterList::shouldIncludeTypeForArgument) -// CHECK1: template<> struct foo<0, 0L> { +// CHECK1: {{^ }}template<> struct foo<0, 0L> { void test() { foo<0, 0 + 0L>::fn(); } @@ -88,6 +88,6 @@ void test() { // powered by the shouldIncludeTypeForArgument functionality. // Not sure if this it's intentional that these two specializations are rendered // differently in this way. -// CHECK1: template<> struct foo<1, 0 + 0L> { +// CHECK1: {{^ }}template<> struct foo<1, 0 + 0L> { template struct foo<1, 0 + 0L>; } -- 2.7.4