we must not issue gc-specific errors in non-gc mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68551
91177308-0d34-0410-b5e6-
96231b3b80d8
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();
--- /dev/null
+// 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
+
+