[cfe-commits] r133861 - in /cfe/trunk: lib/CodeGen/CGObjC.cpp test/CodeGenObjCXX/arc-move.mm

John McCall rjmccall at apple.com
Fri Jun 24 20:51:36 PDT 2011

On Jun 24, 2011, at 8:17 PM, Eli Friedman wrote:
> On Fri, Jun 24, 2011 at 7:26 PM, John McCall <rjmccall at apple.com> wrote:
>> Author: rjmccall
>> Date: Fri Jun 24 21:26:44 2011
>> New Revision: 133861
>> URL: http://llvm.org/viewvc/llvm-project?rev=133861&view=rev
>> Log:
>> Do not apply the ARC move optimization to 'const'-qualified xvalues.
> Why not?

The move optimization involves writing to the source object, which
is a violation of the const contract.  The analogous scenario with
non-POD classes would canonically cause a copy constructor to be
run, not a move constructor.


More information about the cfe-commits mailing list