<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><div>! That's very wrong. Most objects are <i>not</i> copyable, and not all objects that are copyable should actually be copied. You can't actually solve this problem without looking at the setter. If you wanted to go half-way, you could offer alternatives of (copy) vs. <implicitly strong> iff the object's class implements NSCopying.</div><div><br></div><div>Jordan</div><div><br></div><br><div><div>On Jul 9, 2013, at 17:20 , Fariborz Jahanian <<a href="mailto:fjahanian@apple.com">fjahanian@apple.com</a>> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;">Author: fjahanian<br>Date: Tue Jul  9 19:20:11 2013<br>New Revision: 185985<br><br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=185985&view=rev">http://llvm.org/viewvc/llvm-project?rev=185985&view=rev</a><br>Log:<br>objc migrator: More refinment of property<br>attributes in migration. Specialli use of<br>'copy' attribute for retainable object types.<br><br><br>Modified:<br>   cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp<br>   cfe/trunk/test/ARCMT/objcmt-property.m.result<br><br>Modified: cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp?rev=185985&r1=185984&r2=185985&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp?rev=185985&r1=185984&r2=185985&view=diff</a><br>==============================================================================<br>--- cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp (original)<br>+++ cfe/trunk/lib/Edit/RewriteObjCFoundationAPI.cpp Tue Jul  9 19:20:11 2013<br>@@ -362,16 +362,16 @@ bool edit::rewriteToObjCProperty(const O<br>  const ParmVarDecl *argDecl = *Setter->param_begin();<br>  QualType ArgType = argDecl->getType();<br>  Qualifiers::ObjCLifetime propertyLifetime = ArgType.getObjCLifetime();<br>-  if (propertyLifetime != Qualifiers::OCL_None) {<br>-    PropertyString += "(";<br>-    if (propertyLifetime == Qualifiers::OCL_Strong)<br>-      PropertyString += "strong";<br>-    else if (propertyLifetime == Qualifiers::OCL_Weak)<br>-      PropertyString += "weak";<br>-    else<br>-      PropertyString += "unsafe_unretained";<br>-    PropertyString += ")";<br>+  <br>+  if (ArgType->isObjCRetainableType() &&<br>+      propertyLifetime == Qualifiers::OCL_Strong) {<br>+    PropertyString += "(copy)";<br>  }<br>+  else if (propertyLifetime == Qualifiers::OCL_Weak)<br>+    PropertyString += "(weak)";<br>+  else<br>+    PropertyString += "(unsafe_unretained)";<br>+  <br>  QualType PropQT = Getter->getResultType();<br>  PropertyString += " ";<br>  PropertyString += PropQT.getAsString(NS.getASTContext().getPrintingPolicy());<br><br>Modified: cfe/trunk/test/ARCMT/objcmt-property.m.result<br>URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/objcmt-property.m.result?rev=185985&r1=185984&r2=185985&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/test/ARCMT/objcmt-property.m.result?rev=185985&r1=185984&r2=185985&view=diff</a><br>==============================================================================<br>--- cfe/trunk/test/ARCMT/objcmt-property.m.result (original)<br>+++ cfe/trunk/test/ARCMT/objcmt-property.m.result Tue Jul  9 19:20:11 2013<br>@@ -12,7 +12,7 @@<br><br>@property(weak) NSString *__weak WeakProp;<br><br>-@property(strong) NSString * StrongProp;<br>+@property(copy) NSString * StrongProp;<br><br><br>- (NSString *) UnavailProp  __attribute__((unavailable));<br>@@ -42,8 +42,8 @@<br><br><br><br>-@property(strong) NSArray * names2;<br>-@property(strong) NSArray * names3;<br>-@property(strong) NSArray *__strong names4;<br>-@property(strong) NSArray * names1;<br>+@property(copy) NSArray * names2;<br>+@property(copy) NSArray * names3;<br>+@property(copy) NSArray *__strong names4;<br>+@property(copy) NSArray * names1;<br>@end<br><br><br>_______________________________________________<br>cfe-commits mailing list<br><a href="mailto:cfe-commits@cs.uiuc.edu">cfe-commits@cs.uiuc.edu</a><br><a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits</a></div></blockquote></div><br></body></html>