Index: lib/AST/Decl.cpp =================================================================== --- lib/AST/Decl.cpp +++ lib/AST/Decl.cpp @@ -1430,6 +1430,15 @@ } } OS << ')'; + } else if (const EnumDecl *ED = dyn_cast(*I)) { + // C++ [dcl.enum]p10: Each enum-name and each unscoped + // enumerator is declared in the scope that immediately contains + // the enum-specifier. Each scoped enumerator is declared in the + // scope of the enumeration. + if (ED->isScoped()) + OS << *ED; + else + continue; } else { OS << *cast(*I); }