diff options
-rw-r--r-- | lib/Sema/SemaDeclAttr.cpp | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/Sema/SemaDeclAttr.cpp b/lib/Sema/SemaDeclAttr.cpp index cc24735c4a..aceaafcf3a 100644 --- a/lib/Sema/SemaDeclAttr.cpp +++ b/lib/Sema/SemaDeclAttr.cpp @@ -900,9 +900,14 @@ static void HandleWeakImportAttr(Decl *D, const AttributeList &Attr, Sema &S) { // We ignore weak import on properties and methods return; } else if (!(S.LangOpts.ObjCNonFragileABI && isa<ObjCInterfaceDecl>(D))) { - S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type) - << Attr.getName() << 2 /*variable and function*/; - return; + if (S.Context.Target.getTriple().getOS() != llvm::Triple::Darwin || + !isa<ObjCInterfaceDecl>(D) || + S.Context.Target.getTriple().getDarwinMajorNumber() <= 10) { + + S.Diag(Attr.getLoc(), diag::warn_attribute_wrong_decl_type) + << Attr.getName() << 2 /*variable and function*/; + return; + } } // Merge should handle any subsequent violations. |