From 9168e7d9ab74eb36b32e632424cf873318cb31f5 Mon Sep 17 00:00:00 2001 From: Axel Naumann Date: Thu, 7 Dec 2017 08:13:05 +0100 Subject: [PATCH] Move enum attributes after "enum class X: int" (ROOT-9114). With the attribute after "enum" and before the name, the name itself gets annotated and subsequent lookups fail to identify the front-end token. By moving the attribute behind the decl, the identifier is unmodified. --- lib/Interpreter/ForwardDeclPrinter.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/Interpreter/ForwardDeclPrinter.cpp b/lib/Interpreter/ForwardDeclPrinter.cpp index 6815898f..2d5da391 100644 --- a/lib/Interpreter/ForwardDeclPrinter.cpp +++ b/lib/Interpreter/ForwardDeclPrinter.cpp @@ -342,7 +342,6 @@ namespace cling { if (!m_Policy.SuppressSpecifiers && D->isModulePrivate()) Out() << "__module_private__ "; Out() << "enum "; - prettyPrintAttributes(D); if (D->isScoped()) { if (D->isScopedUsingClassTag()) Out() << "class "; @@ -352,8 +351,9 @@ namespace cling { Out() << *D; // if (D->isFixed()) - Out() << " : " << D->getIntegerType().stream(m_Policy) - << ';' << closeBraces << '\n'; + Out() << " : " << D->getIntegerType().stream(m_Policy); + prettyPrintAttributes(D); + Out() << ';' << closeBraces << '\n'; } void ForwardDeclPrinter::VisitRecordDecl(RecordDecl *D) {