From 6df9e076ea410d49d73e967b577a40ed50b454e2 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Sat, 29 Aug 2009 20:36:12 +0000 Subject: [PATCH] In DeclPrinter, assert when asked to print AS_None. llvm-svn: 80437 --- clang/lib/AST/DeclPrinter.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/clang/lib/AST/DeclPrinter.cpp b/clang/lib/AST/DeclPrinter.cpp index 51e15bdbe0ff..191d356755f9 100644 --- a/clang/lib/AST/DeclPrinter.cpp +++ b/clang/lib/AST/DeclPrinter.cpp @@ -169,7 +169,7 @@ void DeclPrinter::ProcessDeclGroup(llvm::SmallVectorImpl& Decls) { void DeclPrinter::Print(AccessSpecifier AS) { switch(AS) { - case AS_none: break; + case AS_none: assert(0 && "No access specifier!"); break; case AS_public: Out << "public"; break; case AS_protected: Out << "protected"; break; case AS_private: Out << " private"; break; @@ -565,7 +565,9 @@ void DeclPrinter::VisitCXXRecordDecl(CXXRecordDecl *D) { if (Base->isVirtual()) Out << "virtual "; - Print(Base->getAccessSpecifierAsWritten()); + AccessSpecifier AS = Base->getAccessSpecifierAsWritten(); + if (AS != AS_none) + Print(AS); Out << " " << Base->getType().getAsString(Policy); } } @@ -867,5 +869,3 @@ void DeclPrinter::VisitUnresolvedUsingDecl(UnresolvedUsingDecl *D) { D->getTargetNestedNameSpecifier()->print(Out, Policy); Out << D->getTargetName().getAsString(); } - -