[clang] 604446a - ast-dump: Add missing identation of class template specializations
David Blaikie via cfe-commits
cfe-commits at lists.llvm.org
Sun Nov 14 21:00:47 PST 2021
Author: David Blaikie
Date: 2021-11-14T20:45:16-08:00
New Revision: 604446aa6b41461e2691c9f4253e9ef70a5d68e4
URL: https://github.com/llvm/llvm-project/commit/604446aa6b41461e2691c9f4253e9ef70a5d68e4
DIFF: https://github.com/llvm/llvm-project/commit/604446aa6b41461e2691c9f4253e9ef70a5d68e4.diff
LOG: ast-dump: Add missing identation of class template specializations
Added:
Modified:
clang/lib/AST/DeclPrinter.cpp
clang/test/AST/ast-dump-templates.cpp
Removed:
################################################################################
diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp
index 884b8e730905..5c6781c26ed7 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 cb2994edcc67..dcecdca58c75 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
//
diff erently in this way.
-// CHECK1: template<> struct foo<1, 0 + 0L> {
+// CHECK1: {{^ }}template<> struct foo<1, 0 + 0L> {
template struct foo<1, 0 + 0L>;
}
More information about the cfe-commits
mailing list