[Bug c++/54509] If Move constructor is templatized then it is invoked else not

2012-09-07 Thread redi at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54509

Jonathan Wakely redi at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||INVALID

--- Comment #2 from Jonathan Wakely redi at gcc dot gnu.org 2012-09-07 
08:31:25 UTC ---
as Daniel said


[Bug c++/54509] If Move constructor is templatized then it is invoked else not

2012-09-06 Thread daniel.kruegler at googlemail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54509

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

   What|Removed |Added

 CC||daniel.kruegler at
   ||googlemail dot com

--- Comment #1 from Daniel Krügler daniel.kruegler at googlemail dot com 
2012-09-07 05:37:56 UTC ---
The language requires that the presence of a user-declared copy-constructor
(which you have used in your code) shall prevent the compiler-declared move
constructor. When _BUG_ is defined, the effect is that the class has a copy
constructor and a template constructor

templatetypename T
Test(T );

but *no* move constructor. The template constructor will always be a better
match for rvalue arguments than the copy constructor, therefore it is called
twice in your program.

In other words: The behavior of gcc looks correct and this report seems invalid
to me.