diff options
-rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 2 | ||||
-rw-r--r-- | clang/test/Sema/weak-import-on-enum.c | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index d43e1f1a9ba..9f025a2b76a 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/lib/Sema/SemaDeclAttr.cpp @@ -1949,7 +1949,7 @@ static void handleWeakImportAttr(Sema &S, Decl *D, const AttributeList &Attr) { << "weak_import" << 2 /*variable and function*/; else if (isa<ObjCPropertyDecl>(D) || isa<ObjCMethodDecl>(D) || (S.Context.getTargetInfo().getTriple().isOSDarwin() && - isa<ObjCInterfaceDecl>(D))) { + (isa<ObjCInterfaceDecl>(D) || isa<EnumDecl>(D)))) { // Nothing to warn about here. } else S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type) diff --git a/clang/test/Sema/weak-import-on-enum.c b/clang/test/Sema/weak-import-on-enum.c new file mode 100644 index 00000000000..3a2c0e5b3a1 --- /dev/null +++ b/clang/test/Sema/weak-import-on-enum.c @@ -0,0 +1,8 @@ +// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-apple-darwin %s +// RUN: %clang_cc1 -triple i386-apple-darwin9 -fsyntax-only -verify %s +// rdar://10277579 + +enum __attribute__((deprecated)) __attribute__((weak_import)) A { + a0 +}; + |