diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index d43e1f1a9b..9f025a2b76 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/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(D) || isa(D) || (S.Context.getTargetInfo().getTriple().isOSDarwin() && - isa(D))) { + (isa(D) || isa(D)))) { // Nothing to warn about here. } else S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type) diff --git a/test/Sema/weak-import-on-enum.c b/test/Sema/weak-import-on-enum.c new file mode 100644 index 0000000000..3a2c0e5b3a --- /dev/null +++ b/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 +}; +