Opened 14 years ago

Closed 10 years ago

#2380 closed Bugs (fixed)

boost::move from lvalue does not work with gcc

Reported by: anonymous Owned by: viboes
Milestone: Boost 1.50.0 Component: thread
Version: Boost 1.44.0 Severity: Problem
Keywords: move thread Cc:

Description

boost::thread make_thread1() {

boost::thread x=make_thread(); return boost::move(x);

}

Compilation of the function above produces the following error with gcc-3.4.4 and 4.3.2:

gcc.compile.c++ ../../../bin.v2/libs/thread/test/test_thread_move.test/gcc-3.4.4 /debug/threading-multi/test_thread_move.o test_thread_move.cpp: In function `boost::thread make_thread1()': test_thread_move.cpp:31: error: no matching function for call to `boost::thread: :thread(boost::thread)' ../../../boost/thread/detail/thread.hpp:200: note: candidates are: boost::thread ::thread(boost::detail::thread_move_t<boost::thread>) ../../../boost/thread/detail/thread.hpp:108: note: boost::thread::thread(boost: :thread&) test_thread_move.cpp:31: error: initializing temporary from result of `boost:: thread::thread(boost::detail::thread_move_t<boost::thread>)'

Attachments (1)

test_thread_move.cpp (1.0 KB ) - added by anonymous 14 years ago.

Download all attachments as: .zip

Change History (10)

by anonymous, 14 years ago

Attachment: test_thread_move.cpp added

comment:1 by Anthony Williams, 14 years ago

Resolution: fixed
Status: newclosed

Fixed on trunk, revision 49112

comment:2 by anonymous, 12 years ago

Milestone: Boost 1.37.0Boost 1.44.0
Version: Boost 1.35.0Boost 1.44.0

Got the same problem on boost 1_44_0 on MacOSX 10.6.4 gcc 4.2.1

$ g++ test_thread_move.cpp -lboost_thread

test_thread_move.cpp: In function ‘boost::thread make_thread1()’:

test_thread_move.cpp:31: error: no matching function for call to ‘boost::thread::thread(boost::thread)’

/usr/local/include/boost/thread/detail/thread.hpp:215: note: candidates are:

boost::thread::thread(boost::detail::thread_move_t<boost::thread>)

/usr/local/include/boost/thread/detail/thread.hpp:113: note: boost::thread::thread(boost::thread&)

test_thread_move.cpp:31: error: initializing temporary from result of ‘boost::thread::thread(boost::detail::thread_move_t<boost::thread>)’

$ uname -a

Darwin macbook-pro.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386

$ g++ -v

Using built-in specs.

Target: i686-apple-darwin10

Configured with: /var/tmp/gcc/gcc-5664~50/src/configure --disable-checking --enable-werror --prefix=/usr -- mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/[cg][.-]*$/s/$/-4.2/ --with- slibdir=/usr/lib --build=i686-apple-darwin10 --program-prefix=i686-apple-darwin10- --host=x86_64-apple-darwin10 -- target=i686-apple-darwin10 --with-gxx-include-dir=/include/c++/4.2.1

Thread model: posix

gcc version 4.2.1 (Apple Inc. build 5664)

comment:3 by viboes, 12 years ago

Milestone: Boost 1.44.0Boost-1.45.0
Resolution: fixed
Status: closedreopened

It seems that this ticket should be reopened.

comment:4 by viboes, 11 years ago

Keywords: thread added
Milestone: Boost 1.45.0To Be Determined

The is an action point to use Boost.Move. Could we consider this as a duplicate of #6194 Adapt to Boost.Move.

comment:5 by viboes, 11 years ago

Keywords: move added

comment:6 by viboes, 11 years ago

Milestone: To Be DeterminedBoost 1.50.0

This test pass on trunk now.

comment:7 by viboes, 11 years ago

Owner: changed from Anthony Williams to viboes
Status: reopenednew

comment:8 by viboes, 10 years ago

Committed in release branch at [78543]

comment:9 by viboes, 10 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.