id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 4367,Proposed fix for test_thread_move_return.cpp,sergey.sprogis@…,Anthony Williams,"Bug description: ---------------- The original statement in test_thread_move_return.cpp (Line 16): return boost::move(t); triggered the following error message in Sun C++ compiler (this compiler assumes that Boost has fix #4305 for boost/thread/detail/thread.hpp): ============================================ ""test_thread_move_return.cpp"", line 16: Error: Cannot use boost::detail::thread_move_t to initialize boost::thread without ""boost::thread::boost::thread(const boost::thread&)"";. 1 Error(s) detected. ============================================ and the same test built with gcc-4.4.4 also failed in a similar way ============================================ test_thread_move_return.cpp: In function 'boost::thread make_thread_move_return(boost::thread::id*)': test_thread_move_return.cpp:16: error: no matching function for call to 'boost::thread::thread(boost::thread)' ../../../boost/thread/detail/thread.hpp:202: note: candidates are: boost::thread::thread(boost::detail::thread_move_t) ../../../boost/thread/detail/thread.hpp:150: note: boost::thread::thread() ../../../boost/thread/detail/thread.hpp:108: note: boost::thread::thread(boost::thread&) ============================================ Sun compiler reports the failure because for the following reason. After finding user-defined copy constructor in boost/thread/detail/thread.hpp (line 108) thread(thread&); compiler does not provide the default copy constructor with 'const' qualifier like thread(const thread&). Then later, when compiler processes test's return statement (line 16) return boost::move(t); a copy constructor is needed to return the temporary thread object by value from make_thread_move_return(), but there is no viable copy constructor. The existing copy constructor cannot be used because it's not allowed to bind an rvalue (the temporary thread object) to a non-const reference. (Std 2003 13.3.3.1.4:3 ) So, the result is an error message mentioned above. Meantime, after replacing return boost::move(t); with return boost::thread(boost::move(t)); compiler does not need copy constructor to create the result object, only user-defined conversion constructor thread(thread_move_t) is used (Std 2003 8.5/14). ",Bugs,closed,,thread,Boost 1.44.0,Problem,invalid,test_thread_move_return,stephen.clamage@…