Objective-C object conforming to 'NSCopying' protocol, infer
a 'copy' property, instead of 'strong'. // rdar://
15525937
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197102
91177308-0d34-0410-b5e6-
96231b3b80d8
static const char *PropertyMemoryAttribute(ASTContext &Context, QualType ArgType) {
Qualifiers::ObjCLifetime propertyLifetime = ArgType.getObjCLifetime();
bool RetainableObject = ArgType->isObjCRetainableType();
- if (RetainableObject && propertyLifetime == Qualifiers::OCL_Strong) {
+ if (RetainableObject &&
+ (propertyLifetime == Qualifiers::OCL_Strong
+ || propertyLifetime == Qualifiers::OCL_None)) {
if (const ObjCObjectPointerType *ObjPtrTy =
ArgType->getAs<ObjCObjectPointerType>()) {
ObjCInterfaceDecl *IDecl = ObjPtrTy->getObjectType()->getInterface();
@property (getter=getStringValue, strong) NSString *stringValue;
@property (getter=getCounterValue, readonly) BOOL counterValue;
-@property (getter=getns_dixtionary, readonly, strong) NSDictionary *ns_dixtionary;
+@property (getter=getns_dixtionary, readonly, copy) NSDictionary *ns_dixtionary;
- (BOOL)is3bar; // watch out
- (NSString *)get3foo; // watch out
@property (NS_NONATOMIC_IOSONLY, getter=getStringValue, strong) NSString *stringValue;
@property (NS_NONATOMIC_IOSONLY, getter=getCounterValue, readonly) BOOL counterValue;
-@property (NS_NONATOMIC_IOSONLY, getter=getns_dixtionary, readonly, strong) NSDictionary *ns_dixtionary;
+@property (NS_NONATOMIC_IOSONLY, getter=getns_dixtionary, readonly, copy) NSDictionary *ns_dixtionary;
- (BOOL)is3bar; // watch out
- (NSString *)get3foo; // watch out
@property (nonatomic, getter=getStringValue, strong) NSString *stringValue;
@property (nonatomic, getter=getCounterValue, readonly) BOOL counterValue;
-@property (nonatomic, getter=getns_dixtionary, readonly, strong) NSDictionary *ns_dixtionary;
+@property (nonatomic, getter=getns_dixtionary, readonly, copy) NSDictionary *ns_dixtionary;
- (BOOL)is3bar; // watch out
- (NSString *)get3foo; // watch out