diff options
author | Douglas Gregor <dgregor@apple.com> | 2011-03-23 13:27:51 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2011-03-23 13:27:51 +0000 |
commit | d71149a45316daef5f86cf63f8435793aeef83bf (patch) | |
tree | a1306e14c3dae5135bfd70da2cd9467fe4a30720 /clang/lib | |
parent | 10ebc189eeb020c5fa253f9cc5ad10d077f64a37 (diff) | |
download | bcm5719-llvm-d71149a45316daef5f86cf63f8435793aeef83bf.tar.gz bcm5719-llvm-d71149a45316daef5f86cf63f8435793aeef83bf.zip |
Ignore weak_import on Objective-C property and method declarations on
all platforms, not just darwin. Fixes the regression in this test case.
llvm-svn: 128147
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Sema/SemaDeclAttr.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaDeclAttr.cpp b/clang/lib/Sema/SemaDeclAttr.cpp index 3f33f144e48..31523229c59 100644 --- a/clang/lib/Sema/SemaDeclAttr.cpp +++ b/clang/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; |