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.
This commit is contained in:
Axel Naumann 2017-12-07 08:13:05 +01:00 committed by sftnight
parent 1193463c6f
commit 9168e7d9ab

View File

@ -342,7 +342,6 @@ namespace cling {
if (!m_Policy.SuppressSpecifiers && D->isModulePrivate()) if (!m_Policy.SuppressSpecifiers && D->isModulePrivate())
Out() << "__module_private__ "; Out() << "__module_private__ ";
Out() << "enum "; Out() << "enum ";
prettyPrintAttributes(D);
if (D->isScoped()) { if (D->isScoped()) {
if (D->isScopedUsingClassTag()) if (D->isScopedUsingClassTag())
Out() << "class "; Out() << "class ";
@ -352,8 +351,9 @@ namespace cling {
Out() << *D; Out() << *D;
// if (D->isFixed()) // if (D->isFixed())
Out() << " : " << D->getIntegerType().stream(m_Policy) Out() << " : " << D->getIntegerType().stream(m_Policy);
<< ';' << closeBraces << '\n'; prettyPrintAttributes(D);
Out() << ';' << closeBraces << '\n';
} }
void ForwardDeclPrinter::VisitRecordDecl(RecordDecl *D) { void ForwardDeclPrinter::VisitRecordDecl(RecordDecl *D) {