The AST printer was dropping attributes on enumerators (enum
constants). Now it's not.
llvm-svn: 292571
void DeclPrinter::VisitEnumConstantDecl(EnumConstantDecl *D) {
Out << *D;
+ prettyPrintAttributes(D);
if (Expr *Init = D->getInitExpr()) {
Out << " = ";
Init->printPretty(Out, nullptr, Policy, Indentation);
// 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));