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:
Fariborz Jahanian 2009-04-07 21:25:06 +00:00
parent d18049ab1d
commit 9ecb84bb21
2 changed files with 16 additions and 1 deletions

View File

@ -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();

View File

@ -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