[cfe-commits] r80437 - /cfe/trunk/lib/AST/DeclPrinter.cpp
Anders Carlsson
andersca at mac.com
Sat Aug 29 13:36:12 PDT 2009
Author: andersca
Date: Sat Aug 29 15:36:12 2009
New Revision: 80437
URL: http://llvm.org/viewvc/llvm-project?rev=80437&view=rev
Log:
In DeclPrinter, assert when asked to print AS_None.
Modified:
cfe/trunk/lib/AST/DeclPrinter.cpp
Modified: cfe/trunk/lib/AST/DeclPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/DeclPrinter.cpp?rev=80437&r1=80436&r2=80437&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclPrinter.cpp (original)
+++ cfe/trunk/lib/AST/DeclPrinter.cpp Sat Aug 29 15:36:12 2009
@@ -169,7 +169,7 @@
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 @@
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 @@
D->getTargetNestedNameSpecifier()->print(Out, Policy);
Out << D->getTargetName().getAsString();
}
-
-
More information about the cfe-commits
mailing list