Do not warn when weak-import attribute is applied to enum

decl. in Darwin due to certain projects requirement. 
// rdar://10277579

llvm-svn: 143082
This commit is contained in:
Fariborz Jahanian
2011-10-26 23:59:12 +00:00
parent 58dba012b6
commit 3249a1e862
2 changed files with 9 additions and 1 deletions

View File

@@ -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)

View File

@@ -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
};