$ cat bug.cpp template < typename T > struct X { X( X const&& o ) { o.f(); // <-- accepted. } int f(); };
struct Y { Y( Y const&& o ) { o.f(); // <-- rejected. } int f(); }; $ /opt/gcc43/bin/g++ bug.cpp -c -std=c++0x bug.cpp: In constructor 'Y::Y(const Y&&)': bug.cpp:15: error: passing 'const Y' as 'this' argument of 'int Y::f()' discards qualifiers gcc version 4.3.0 20080102 -- Summary: c++0x: non-const method accepted for const&& object. Product: gcc Version: 4.3.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pluto at agmk dot net http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34666