r285979 - Do not print enum underlying type if language is not C++11
Serge Pavlov via cfe-commits
cfe-commits at lists.llvm.org
Thu Nov 3 23:03:35 PDT 2016
Author: sepavloff
Date: Fri Nov 4 01:03:34 2016
New Revision: 285979
URL: http://llvm.org/viewvc/llvm-project?rev=285979&view=rev
Log:
Do not print enum underlying type if language is not C++11
Output generated by option '-ast-print' must not contains enum
base type specifications if source language does not include C++11.
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=285979&r1=285978&r2=285979&view=diff
==============================================================================
--- cfe/trunk/lib/AST/DeclPrinter.cpp (original)
+++ cfe/trunk/lib/AST/DeclPrinter.cpp Fri Nov 4 01:03:34 2016
@@ -407,7 +407,7 @@ void DeclPrinter::VisitEnumDecl(EnumDecl
}
Out << *D;
- if (D->isFixed())
+ if (D->isFixed() && D->getASTContext().getLangOpts().CPlusPlus11)
Out << " : " << D->getIntegerType().stream(Policy);
if (D->isCompleteDefinition()) {
More information about the cfe-commits
mailing list