aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclAttr.cpp
diff options
context:
space:
mode:
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;