summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/lib/Edit/RewriteObjCFoundationAPI.cpp18
-rw-r--r--clang/test/ARCMT/objcmt-property.m.result10
2 files changed, 14 insertions, 14 deletions
diff --git a/clang/lib/Edit/RewriteObjCFoundationAPI.cpp b/clang/lib/Edit/RewriteObjCFoundationAPI.cpp
index 05abbed14c3..e257a0b6f1c 100644
--- a/clang/lib/Edit/RewriteObjCFoundationAPI.cpp
+++ b/clang/lib/Edit/RewriteObjCFoundationAPI.cpp
@@ -362,16 +362,16 @@ bool edit::rewriteToObjCProperty(const ObjCMethodDecl *Getter,
const ParmVarDecl *argDecl = *Setter->param_begin();
QualType ArgType = argDecl->getType();
Qualifiers::ObjCLifetime propertyLifetime = ArgType.getObjCLifetime();
- if (propertyLifetime != Qualifiers::OCL_None) {
- PropertyString += "(";
- if (propertyLifetime == Qualifiers::OCL_Strong)
- PropertyString += "strong";
- else if (propertyLifetime == Qualifiers::OCL_Weak)
- PropertyString += "weak";
- else
- PropertyString += "unsafe_unretained";
- PropertyString += ")";
+
+ if (ArgType->isObjCRetainableType() &&
+ propertyLifetime == Qualifiers::OCL_Strong) {
+ PropertyString += "(copy)";
}
+ else if (propertyLifetime == Qualifiers::OCL_Weak)
+ PropertyString += "(weak)";
+ else
+ PropertyString += "(unsafe_unretained)";
+
QualType PropQT = Getter->getResultType();
PropertyString += " ";
PropertyString += PropQT.getAsString(NS.getASTContext().getPrintingPolicy());
diff --git a/clang/test/ARCMT/objcmt-property.m.result b/clang/test/ARCMT/objcmt-property.m.result
index 49162a46914..11912d950a2 100644
--- a/clang/test/ARCMT/objcmt-property.m.result
+++ b/clang/test/ARCMT/objcmt-property.m.result
@@ -12,7 +12,7 @@
@property(weak) NSString *__weak WeakProp;
-@property(strong) NSString * StrongProp;
+@property(copy) NSString * StrongProp;
- (NSString *) UnavailProp __attribute__((unavailable));
@@ -42,8 +42,8 @@
-@property(strong) NSArray * names2;
-@property(strong) NSArray * names3;
-@property(strong) NSArray *__strong names4;
-@property(strong) NSArray * names1;
+@property(copy) NSArray * names2;
+@property(copy) NSArray * names3;
+@property(copy) NSArray *__strong names4;
+@property(copy) NSArray * names1;
@end
OpenPOWER on IntegriCloud