From dbe8890be22cbfd2d9e28277abb974ded8fb06ab Mon Sep 17 00:00:00 2001 From: Michael Han Date: Mon, 25 Feb 2013 18:40:11 +0000 Subject: [PATCH] Fix empty declaration printing. Don't print the semicolon when visiting an empty declaration because the semicolon will be printed as a terminator later. llvm-svn: 176035 --- clang/lib/AST/DeclPrinter.cpp | 1 - clang/test/SemaCXX/cxx11-ast-print.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp index 2be0b6c80461..e2a66fb8a74a 100644 --- a/clang/lib/AST/DeclPrinter.cpp +++ b/clang/lib/AST/DeclPrinter.cpp @@ -726,7 +726,6 @@ void DeclPrinter::VisitNamespaceAliasDecl(NamespaceAliasDecl *D) { void DeclPrinter::VisitEmptyDecl(EmptyDecl *D) { prettyPrintAttributes(D); - Out << ";\n"; } void DeclPrinter::VisitCXXRecordDecl(CXXRecordDecl *D) { diff --git a/clang/test/SemaCXX/cxx11-ast-print.cpp b/clang/test/SemaCXX/cxx11-ast-print.cpp index 8e9480476c12..f95eeb50fefb 100644 --- a/clang/test/SemaCXX/cxx11-ast-print.cpp +++ b/clang/test/SemaCXX/cxx11-ast-print.cpp @@ -40,3 +40,4 @@ const char *p9 = 0x42e3F_fritz; const char *p10 = 3.300e+15_fritz; // CHECK: ; ; +// CHECK-NOT: ;