summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2011-10-13 23:45:45 +0000
committerFariborz Jahanian <fjahanian@apple.com>2011-10-13 23:45:45 +0000
commitdf4f7ca331f04c7e6a4af3a144a05d3a82f8770d (patch)
tree87e8c930cdff7ff4ddbcc6a3802450d0087e055b /clang
parenta7ad9f3932b4576815b35d599b75fe4fa3a7611f (diff)
downloadbcm5719-llvm-df4f7ca331f04c7e6a4af3a144a05d3a82f8770d.tar.gz
bcm5719-llvm-df4f7ca331f04c7e6a4af3a144a05d3a82f8770d.zip
objc-arc: 'Class' property is implicitly __unsafe_unretained.
// rdar://10239594 llvm-svn: 141915
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Sema/SemaObjCProperty.cpp2
-rw-r--r--clang/test/SemaObjC/arc-property-lifetime.m15
2 files changed, 16 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp
index 33069928f24..751f553945c 100644
--- a/clang/lib/Sema/SemaObjCProperty.cpp
+++ b/clang/lib/Sema/SemaObjCProperty.cpp
@@ -39,7 +39,7 @@ static Qualifiers::ObjCLifetime getImpliedARCOwnership(
if (attrs & (ObjCPropertyDecl::OBJC_PR_retain |
ObjCPropertyDecl::OBJC_PR_strong |
ObjCPropertyDecl::OBJC_PR_copy)) {
- return Qualifiers::OCL_Strong;
+ return type->getObjCARCImplicitLifetime();
} else if (attrs & ObjCPropertyDecl::OBJC_PR_weak) {
return Qualifiers::OCL_Weak;
} else if (attrs & ObjCPropertyDecl::OBJC_PR_unsafe_unretained) {
diff --git a/clang/test/SemaObjC/arc-property-lifetime.m b/clang/test/SemaObjC/arc-property-lifetime.m
index cbed455ddc8..9cc3ada15fa 100644
--- a/clang/test/SemaObjC/arc-property-lifetime.m
+++ b/clang/test/SemaObjC/arc-property-lifetime.m
@@ -110,3 +110,18 @@
@synthesize isAutosaving = _isAutosaving;
@end
+// rdar://10239594
+// Test for 'Class' properties being unretained.
+@interface MyClass {
+@private
+ Class _controllerClass;
+ id _controllerId;
+}
+@property (copy) Class controllerClass;
+@property (copy) id controllerId;
+@end
+
+@implementation MyClass
+@synthesize controllerClass = _controllerClass;
+@synthesize controllerId = _controllerId;
+@end
OpenPOWER on IntegriCloud