forked from OSchip/llvm-project
Now that we have __weak defined as attribute in all modes,
we must not issue gc-specific errors in non-gc mode. llvm-svn: 68551
This commit is contained in:
parent
d18049ab1d
commit
9ecb84bb21
|
@ -1825,7 +1825,8 @@ Sema::DeclPtrTy Sema::ActOnPropertyImplDecl(SourceLocation AtLoc,
|
|||
return DeclPtrTy();
|
||||
}
|
||||
// __weak is explicit. So it works on Canonical type.
|
||||
if (PropType.isObjCGCWeak() && !IvarType.isObjCGCWeak()) {
|
||||
if (PropType.isObjCGCWeak() && !IvarType.isObjCGCWeak() &&
|
||||
getLangOptions().getGCMode() != LangOptions::NonGC) {
|
||||
Diag(PropertyLoc, diag::error_weak_property)
|
||||
<< property->getDeclName() << Ivar->getDeclName();
|
||||
return DeclPtrTy();
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
// RUN: clang-cc -fsyntax-only -verify %s
|
||||
|
||||
@interface Subtask
|
||||
{
|
||||
id _delegate;
|
||||
}
|
||||
@property(nonatomic,readwrite,assign) id __weak delegate;
|
||||
@end
|
||||
|
||||
@implementation Subtask
|
||||
@synthesize delegate = _delegate;
|
||||
@end
|
||||
|
||||
|
Loading…
Reference in New Issue