<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Jan 24, 2012, at 11:11 AM, Douglas Gregor wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">On Jan 24, 2012, at 10:05 AM, Fariborz Jahanian wrote:<br><br><blockquote type="cite">Author: fjahanian<br></blockquote><blockquote type="cite">Date: Tue Jan 24 12:05:45 2012<br></blockquote><blockquote type="cite">New Revision: 148823<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project?rev=148823&view=rev">http://llvm.org/viewvc/llvm-project?rev=148823&view=rev</a><br></blockquote><blockquote type="cite">Log:<br></blockquote><blockquote type="cite">objc: issue error if assigning objects in fragile-abi too.<br></blockquote><blockquote type="cite">//<span class="Apple-converted-space"> </span><a href="rdar://10731065">rdar://10731065</a><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Added:<br></blockquote><blockquote type="cite">  cfe/trunk/test/SemaObjCXX/fragile-abi-object-assign.m<br></blockquote><blockquote type="cite">Modified:<br></blockquote><blockquote type="cite">  cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br></blockquote><blockquote type="cite">  cfe/trunk/lib/Sema/SemaExpr.cpp<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td<br></blockquote><blockquote type="cite">URL:<span class="Apple-converted-space"> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=148823&r1=148822&r2=148823&view=diff">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=148823&r1=148822&r2=148823&view=diff</a><br></blockquote><blockquote type="cite">==============================================================================<br></blockquote><blockquote type="cite">--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)<br></blockquote><blockquote type="cite">+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Tue Jan 24 12:05:45 2012<br></blockquote><blockquote type="cite">@@ -3608,6 +3608,8 @@<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">def err_assignment_requires_nonfragile_object : Error<<br></blockquote><blockquote type="cite"> "cannot assign to class object in non-fragile ABI (%0 invalid)">;<br></blockquote><blockquote type="cite">+def err_objc_object_assignment : Error<<br></blockquote><blockquote type="cite">+  "cannot assign to class object - use memcpy instead">;<br></blockquote><br>Do we really want to suggest that users use memcpy to copy Objective-C objects? That seems… horribly error-prone, and not at all recommended because it will break under the non-fragile ABI. How about just complaining that classes cannot be assigned at all? If some clever user wants to shoot himself in the foot by using memcpy, at least we don't want to be blamed for giving him the gun...<br></span></blockquote></div><br><div>Agreed.  People should just stop doing this.  Suggesting them to use memcpy is just as bad as the original idiom.</div></body></html>