Hello, Is it a bug or am I missing something?
$ cat test.cpp #include <memory> struct X { X()=default; X(X&&)=default; }; X test() { X const a={}; return std::move(a); } $ g++ -c -std=c++0x test.cpp test.cpp: In function 'X test()': test.cpp:10:22: error: no matching function for call to 'X::X(std::remove_reference<const X&>::type)' test.cpp:5:4: note: candidates are: constexpr X::X(X&&) test.cpp:4:4: note: constexpr X::X() This is v4.6. v4.5 is happy here. Thanks