forked from OSchip/llvm-project
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
This commit is contained in:
parent
10ebc189ee
commit
d71149a453
|
@ -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;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
// RUN: %clang_cc1 -fsyntax-only -verify %s
|
||||
|
||||
@interface foo
|
||||
+ (void) cx __attribute__((weak_import));
|
||||
- (void) x __attribute__((weak_import));
|
||||
|
|
Loading…
Reference in New Issue