This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/46246] [C++0x] Move constructor required when passing a temporary by copy, but not actually used
- From: "a.pignotti at sssup dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 30 Oct 2010 16:31:29 +0000
- Subject: [Bug c++/46246] [C++0x] Move constructor required when passing a temporary by copy, but not actually used
- Auto-submitted: auto-generated
- References: <bug-46246-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46246
--- Comment #2 from Alessandro Pignotti <a.pignotti at sssup dot it> 2010-10-30 16:31:27 UTC ---
The secondo attachment compiles, but the move constructor seems not really
used. The output is:
default bar
foo called
Moreover i was expecting a call to the copy constructor but that was elided, is
this an optimization or something mandated by the standard?