aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2009-04-10 22:42:54 +0000
committerFariborz Jahanian <fjahanian@apple.com>2009-04-10 22:42:54 +0000
commit0a9217f5462d067435e4fc32307c018350d59d38 (patch)
treeeeff69e1bd250cec9bc157110648ab70c905addf
parent64c2e0762628eba26c100642521b6100c2515cc5 (diff)
Fix another fallout from defining __weak unconditionally.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68834 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Sema/SemaDeclObjC.cpp3
-rw-r--r--test/SemaObjC/no-gc-weak-test.m14
2 files changed, 16 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index 898ecbb471..74a0316431 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -1840,7 +1840,8 @@ Sema::DeclPtrTy Sema::ActOnPropertyImplDecl(SourceLocation AtLoc,
return DeclPtrTy();
}
if ((Context.isObjCObjectPointerType(property->getType()) ||
- PropType.isObjCGCStrong()) && IvarType.isObjCGCWeak()) {
+ PropType.isObjCGCStrong()) && IvarType.isObjCGCWeak() &&
+ getLangOptions().getGCMode() != LangOptions::NonGC) {
Diag(PropertyLoc, diag::error_strong_property)
<< property->getDeclName() << Ivar->getDeclName();
return DeclPtrTy();
diff --git a/test/SemaObjC/no-gc-weak-test.m b/test/SemaObjC/no-gc-weak-test.m
index 03a881f589..f494929ce0 100644
--- a/test/SemaObjC/no-gc-weak-test.m
+++ b/test/SemaObjC/no-gc-weak-test.m
@@ -12,3 +12,17 @@
@end
+@interface PVSelectionOverlayView2
+{
+ id __weak _selectionRect;
+}
+
+@property(assign) id selectionRect;
+
+@end
+
+@implementation PVSelectionOverlayView2
+
+@synthesize selectionRect = _selectionRect;
+@end
+