]> granicus.if.org Git - clang/commitdiff
Special-case handling of destructors in override lists when dumping ASTs.
authorLang Hames <lhames@gmail.com>
Tue, 20 Jun 2017 21:30:43 +0000 (21:30 +0000)
committerLang Hames <lhames@gmail.com>
Tue, 20 Jun 2017 21:30:43 +0000 (21:30 +0000)
Fixes a bug in r305850: CXXDestructors don't have names, so we need to handle
printing of them separately.

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

lib/AST/ASTDumper.cpp

index 95a02deb33eb05b1a58b6dd3dfe514e110233eef..4758109fbcf770e97c4e10a9d1b65d9a96992d86 100644 (file)
@@ -1189,9 +1189,12 @@ void ASTDumper::VisitFunctionDecl(const FunctionDecl *D) {
       auto dumpOverride =
         [=](const CXXMethodDecl *D) {
           SplitQualType T_split = D->getType().split();
-          OS << D << " " << D->getParent()->getName() << "::"
-             << D->getName() << " '"
-             << QualType::getAsString(T_split) << "'";
+          OS << D << " " << D->getParent()->getName() << "::";
+          if (isa<CXXDestructorDecl>(D))
+            OS << "~" << D->getParent()->getName();
+          else
+            OS << D->getName();
+          OS << " '" << QualType::getAsString(T_split) << "'";
         };
 
       dumpChild([=] {