aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-03-23 13:27:51 +0000
committerDouglas Gregor <dgregor@apple.com>2011-03-23 13:27:51 +0000
commitdef863192f83d8033e1833b48ae8119a65dfc7c8 (patch)
tree6f66c05deb43157278b763781daeb9ed7d3d169a /lib/Sema/SemaDeclAttr.cpp
parent7f9fc3f7ce076645cb6aefc99c64d9446caf13d6 (diff)
Ignore weak_import on Objective-C property and method declarations on
all platforms, not just darwin. Fixes the regression in this test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@128147 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclAttr.cpp')
-rw-r--r--lib/Sema/SemaDeclAttr.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp
index 3f33f144e4..31523229c5 100644
--- a/lib/Sema/SemaDeclAttr.cpp
+++ b/lib/Sema/SemaDeclAttr.cpp
@@ -1436,10 +1436,11 @@ static void HandleWeakImportAttr(Decl *D, const AttributeList &Attr, Sema &S) {
S.Diag(Attr.getLoc(),
diag::warn_attribute_weak_import_invalid_on_definition)
<< "weak_import" << 2 /*variable and function*/;
- else if (S.Context.Target.getTriple().getOS() != llvm::Triple::Darwin ||
- (!isa<ObjCInterfaceDecl>(D) &&
- !isa<ObjCPropertyDecl>(D) &&
- !isa<ObjCMethodDecl>(D)))
+ else if (isa<ObjCPropertyDecl>(D) || isa<ObjCMethodDecl>(D) ||
+ (S.Context.Target.getTriple().getOS() == llvm::Triple::Darwin &&
+ isa<ObjCInterfaceDecl>(D))) {
+ // Nothing to warn about here.
+ } else
S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type)
<< Attr.getName() << ExpectedVariableOrFunction;