diff options
author | Anders Carlsson <andersca@mac.com> | 2009-08-29 20:36:12 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-08-29 20:36:12 +0000 |
commit | 018e9fead456a6bdcde68dba7cc1aa4a7ee8d639 (patch) | |
tree | 554dd94609a07ba9cef807cbbd16b76c120110ab /lib/AST/DeclPrinter.cpp | |
parent | 383d29853331e4f6c0c720a1df9cab31f6ab3dba (diff) |
In DeclPrinter, assert when asked to print AS_None.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@80437 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/DeclPrinter.cpp')
-rw-r--r-- | lib/AST/DeclPrinter.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp index 51e15bdbe0..191d356755 100644 --- a/lib/AST/DeclPrinter.cpp +++ b/lib/AST/DeclPrinter.cpp @@ -169,7 +169,7 @@ void DeclPrinter::ProcessDeclGroup(llvm::SmallVectorImpl<Decl*>& 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(); } - - |