[cfe-dev] return lvalue move instead of copy?

Stephan Bergmann via cfe-dev cfe-dev at lists.llvm.org
Thu Aug 30 00:42:18 PDT 2018


On 30/08/18 00:06, Richard Smith wrote:
> GCC does not implement one part of the relevant language rule. 
> Specifically, the rule is ([class.copy.elision]p3):
> 
>    "[After performing overload resolution for an implicit move from an 
> rvalue,] if the type of the first parameter of the selected constructor 
> is not an rvalue reference to the object's type (possibly-cv-qualified), 
> [a copy is used instead of a move]"

Thanks, that's the part I missed.  (Filed 
<https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87150> "move ctor wrongly 
chosen in return stmt (derived vs. base)" now.)



More information about the cfe-dev mailing list