objc-arc: 'Class' property is implicitly __unsafe_unretained.

// rdar://10239594

llvm-svn: 141915
This commit is contained in:
Fariborz Jahanian 2011-10-13 23:45:45 +00:00
parent a7ad9f3932
commit df4f7ca331
2 changed files with 16 additions and 1 deletions

View File

@ -39,7 +39,7 @@ static Qualifiers::ObjCLifetime getImpliedARCOwnership(
if (attrs & (ObjCPropertyDecl::OBJC_PR_retain | if (attrs & (ObjCPropertyDecl::OBJC_PR_retain |
ObjCPropertyDecl::OBJC_PR_strong | ObjCPropertyDecl::OBJC_PR_strong |
ObjCPropertyDecl::OBJC_PR_copy)) { ObjCPropertyDecl::OBJC_PR_copy)) {
return Qualifiers::OCL_Strong; return type->getObjCARCImplicitLifetime();
} else if (attrs & ObjCPropertyDecl::OBJC_PR_weak) { } else if (attrs & ObjCPropertyDecl::OBJC_PR_weak) {
return Qualifiers::OCL_Weak; return Qualifiers::OCL_Weak;
} else if (attrs & ObjCPropertyDecl::OBJC_PR_unsafe_unretained) { } else if (attrs & ObjCPropertyDecl::OBJC_PR_unsafe_unretained) {

View File

@ -110,3 +110,18 @@
@synthesize isAutosaving = _isAutosaving; @synthesize isAutosaving = _isAutosaving;
@end @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