mirror of
https://github.com/intel/llvm.git
synced 2026-01-19 01:15:50 +08:00
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:
@@ -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)
|
||||
|
||||
8
clang/test/Sema/weak-import-on-enum.c
Normal file
8
clang/test/Sema/weak-import-on-enum.c
Normal 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
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user