[Bug c++/57610] Reference initialized with temporary instead of sub-object of conversion result

daniel.kruegler at googlemail dot com gcc-bugzilla@gcc.gnu.org
Fri Jun 14 18:28:00 GMT 2013


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57610

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #6 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
1) Your example code is a bit misleading, because irrespective of your concerns
the compiler is allowed to create one copy of B (and thus of A) when returning
the B value as result of the function call. You cannot rely on that the
compiler will not create at one copy and that is not related to this issue.

2) The core language was considering to change exactly this wording you
mention, see

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1287

The part related to the example was deferred and my understanding is that

http://www.open-std.org/jtc1/sc22/wg21/docs/cwg_active.html#1650

is now focusing on class prvalues during reference-binding sub-part. My
suggestion is to suspend this bug until this core issue CWG 1650 has been
resolved.


More information about the Gcc-bugs mailing list