http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46246
Jason Merrill jason at gcc dot gnu.org changed:
What|Removed |Added
Status|UNCONFIRMED |RESOLVED
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46246
Paolo Carlini paolo.carlini at oracle dot com changed:
What|Removed |Added
CC||jason at
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46246
--- Comment #4 from Jonathan Wakely redi at gcc dot gnu.org 2010-10-31
12:05:00 UTC ---
Copy elision is an optimisation allowed by the standard, but not mandated.
-fno-elide-constructors to disable it, then you should see the move constructor
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46246
--- Comment #5 from Paolo Carlini paolo.carlini at oracle dot com 2010-10-31
13:28:14 UTC ---
Makes sense, of course (I'm not used to private or protected deleted members).
Thus looks like this can closed as invalid?
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46246
--- Comment #6 from Alessandro Pignotti a.pignotti at sssup dot it 2010-10-31
15:10:22 UTC ---
Please consider the first test case before declaring this bug invalid. I think
should be legal to delete the move construtor and still being able to
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46246
--- Comment #7 from Jonathan Wakely redi at gcc dot gnu.org 2010-11-01
00:15:33 UTC ---
No, a deleted function can still be selected by overload resolution. Defining a
move constructor as deleted does not have the semantics you want.
In the
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46246
--- Comment #1 from Alessandro Pignotti a.pignotti at sssup dot it 2010-10-30
16:28:49 UTC ---
Created attachment 22209
-- http://gcc.gnu.org/bugzilla/attachment.cgi?id=22209
test case that shows that the move constructor is not actually used
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