Index: lib/AST/DeclPrinter.cpp =================================================================== --- lib/AST/DeclPrinter.cpp +++ lib/AST/DeclPrinter.cpp @@ -438,6 +438,7 @@ void DeclPrinter::VisitEnumConstantDecl(EnumConstantDecl *D) { Out << *D; + prettyPrintAttributes(D); if (Expr *Init = D->getInitExpr()) { Out << " = "; Init->printPretty(Out, nullptr, Policy, Indentation); Index: test/Sema/ast-print.c =================================================================== --- test/Sema/ast-print.c +++ test/Sema/ast-print.c @@ -65,3 +65,12 @@ // CHECK: } z = {(struct Z){}}; } z = {(struct Z){}}; } + +// CHECK-LABEL: enum EnumWithAttributes { +enum EnumWithAttributes { + // CHECK-NEXT: EnumWithAttributesFoo __attribute__((deprecated(""))), + EnumWithAttributesFoo __attribute__((deprecated)), + // CHECK-NEXT: EnumWithAttributesBar __attribute__((unavailable(""))) = 50 + EnumWithAttributesBar __attribute__((unavailable)) = 50 + // CHECK-NEXT: } __attribute__((deprecated(""))) +} __attribute__((deprecated));