Implement the preference for move-construction over copy-construction
commit49a3491f1e7448e01339fb096f38681ec5dcd792
authorDouglas Gregor <doug.gregor@gmail.com>
Fri, 21 Jan 2011 19:38:21 +0000 (21 19:38 +0000)
committerDouglas Gregor <doug.gregor@gmail.com>
Fri, 21 Jan 2011 19:38:21 +0000 (21 19:38 +0000)
tree6d229587f576842290d3770ef4aa8518cd7b1abc
parent0a5762a4aea155af9dccefd5e785a0255cfc730c
Implement the preference for move-construction over copy-construction
when returning an NRVO candidate expression. For example, this
properly picks the move constructor when dealing with code such as

  MoveOnlyType f() { MoveOnlyType mot; return mot; }

The previously-XFAIL'd rvalue-references test case now works, and has
been moved into the appropriate paragraph-specific test case.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123992 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/AST/DeclCXX.h
lib/AST/DeclCXX.cpp
lib/Sema/SemaInit.cpp
lib/Sema/SemaStmt.cpp
test/CXX/special/class.copy/p33-0x.cpp [new file with mode: 0644]
test/SemaCXX/rval-references-examples.cpp
test/SemaCXX/rval-references-xfail.cpp [deleted file]