This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/58051] [DR1579] No named return value optimization when returned object is implicitly converted


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=58051

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-06-26
            Summary|No named return value       |[DR1579] No named return
                   |optimization when returned  |value optimization when
                   |object is implicitly        |returned object is
                   |converted                   |implicitly converted
     Ever confirmed|0                           |1

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Ryan Johnson from comment #0)
> RVO works properly if go() returns A() or std::move(rval).

RVO is already working properly, C++11 did not allow the expression in the
return statement to be treated as an rvalue when it is a different type to the
function's return type.

However the standard changed:
http://open-std.org/jtc1/sc22/wg21/docs/cwg_defects.html#1579


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]