]> granicus.if.org Git - clang/commitdiff
Fix empty declaration printing.
authorMichael Han <fragmentshaders@gmail.com>
Mon, 25 Feb 2013 18:40:11 +0000 (18:40 +0000)
committerMichael Han <fragmentshaders@gmail.com>
Mon, 25 Feb 2013 18:40:11 +0000 (18:40 +0000)
Don't print the semicolon when visiting an empty declaration because the semicolon
will be printed as a terminator later.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@176035 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/DeclPrinter.cpp
test/SemaCXX/cxx11-ast-print.cpp

index 2be0b6c80461fd9cf6cfe69ccd86b7805602adb8..e2a66fb8a74a0434ef20bb012f6653d4dc92a3f8 100644 (file)
@@ -726,7 +726,6 @@ void DeclPrinter::VisitNamespaceAliasDecl(NamespaceAliasDecl *D) {
 
 void DeclPrinter::VisitEmptyDecl(EmptyDecl *D) {
   prettyPrintAttributes(D);
-  Out << ";\n";
 }
 
 void DeclPrinter::VisitCXXRecordDecl(CXXRecordDecl *D) {
index 8e9480476c12075a1f3dcae6b10dda2c0ae97f1b..f95eeb50fefbc96e7e805f801ac759d43a9031e3 100644 (file)
@@ -40,3 +40,4 @@ const char *p9 = 0x42e3F_fritz;
 const char *p10 = 3.300e+15_fritz;
 // CHECK: ;
 ;
+// CHECK-NOT: ;