[Bug c++/66632] Incorrect use of default constructor to initialize isolated rvalue.

daniel.kruegler at googlemail dot com gcc-bugzilla@gcc.gnu.org
Tue Jun 23 18:14:00 GMT 2015


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

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

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

--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
The program output looks correct to me. You are misinterpreting what the
semantics of the code is. The construct

Q(S1v1);

declares a variable of type Q with name S1v1, it therefore hides the enumerator
name in the next line. The next line just performs a copy of the variable S1v1
to produce the variable q2. In other words, this is not a defect.


More information about the Gcc-bugs mailing list