From: Serge Pavlov Date: Fri, 4 Nov 2016 06:03:34 +0000 (+0000) Subject: Do not print enum underlying type if language is not C++11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=952623ea07ede0056e56b2c9e10a813907a154c9;p=clang 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@285979 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/DeclPrinter.cpp b/lib/AST/DeclPrinter.cpp index 4a8db43817..921c8e3fed 100644 --- a/lib/AST/DeclPrinter.cpp +++ b/lib/AST/DeclPrinter.cpp @@ -407,7 +407,7 @@ void DeclPrinter::VisitEnumDecl(EnumDecl *D) { } Out << *D; - if (D->isFixed()) + if (D->isFixed() && D->getASTContext().getLangOpts().CPlusPlus11) Out << " : " << D->getIntegerType().stream(Policy); if (D->isCompleteDefinition()) {