Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3844: boost.thread doesn't work with gcc-4.5 in c++0x mode
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-04-28 18:19:03
#3844: boost.thread doesn't work with gcc-4.5 in c++0x mode
----------------------------------------------------+-----------------------
Reporter: Sebastian Mingramm <s.mingramm@â¦> | Owner: anthonyw
Type: Bugs | Status: new
Milestone: Boost 1.42.0 | Component: thread
Version: Boost 1.41.0 | Severity: Problem
Keywords: |
----------------------------------------------------+-----------------------
Comment(by mlrus@â¦):
Might be a boost bug "In fact it's try to bind the reference to an lvalue,
which is invalid" according to Bugzilla Bug 43915
{{{
inline thread&& move(thread&& t)
{
return t;
}
At the point of return 't' is an lvalue so to return it as an rvalue it
needs
to be static_cast<thread&&>(t)
}}}
Replying to [ticket:3844 Sebastian Mingramm <s.mingramm@â¦>]:
> {{{
> $ cat test.cpp
> #include <boost/thread.hpp>
> int main() {}
>
> $ g++ -v
> }}}
> Using built-in specs.
> COLLECT_GCC=g++
> COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/4.5.0
/lto-wrapper
> Target: x86_64-pc-linux-gnu
> Configured with: ./configure --host=x86_64-pc-linux-gnu --build=x86_64
-pc-linux-gnu --disable-altivec --disable-fixed-point --with-ppl --with-
cloog --disable-nls --with-system-zlib --disable-checking --disable-werror
--enable-secureplt --enable-multilib --enable-libmudflap --disable-libssp
--enable-libgomp --enable-cld --enable-languages=c,c++ --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--enable-lto
> Thread model: posix
> gcc version 4.5.0 20100115 (experimental) (GCC)
>
> {{{
> $ g++ test.cpp -std=c++0x
> }}}
> In file included from /usr/include/boost/thread/thread.hpp:22:0,
> from /usr/include/boost/thread.hpp:13,
> from test.cpp:1:
> /usr/include/boost/thread/detail/thread.hpp: In function
'boost::thread&& boost::move(boost::thread&&)':
> /usr/include/boost/thread/detail/thread.hpp:349:16: error: invalid
initialization of reference of type 'boost::thread&&' from expression of
type 'boost::thread'
> In file included from
/usr/include/boost/thread/detail/thread_heap_alloc.hpp:17:0,
> from /usr/include/boost/thread/detail/thread.hpp:13,
> from /usr/include/boost/thread/thread.hpp:22,
> from /usr/include/boost/thread.hpp:13,
> from test.cpp:1:
> /usr/include/boost/thread/pthread/thread_heap_alloc.hpp: In function 'T*
boost::detail::heap_new(A1&&) [with T = boost::detail::thread_data<void
(*)()>, A1 = void (*&)()]':
> /usr/include/boost/thread/detail/thread.hpp:130:95: instantiated from
here
> /usr/include/boost/thread/pthread/thread_heap_alloc.hpp:24:47: error:
cannot bind 'void (*)()' lvalue to 'void (*&&)()'
> /usr/include/boost/thread/detail/thread.hpp:43:13: error: initializing
argument 1 of 'boost::detail::thread_data<F>::thread_data(F&&) [with F =
void (*)()]'
> In file included from /usr/include/boost/thread/pthread/mutex.hpp:11:0,
> from /usr/include/boost/thread/mutex.hpp:16,
> from
/usr/include/boost/thread/pthread/thread_data.hpp:12,
> from /usr/include/boost/thread/thread.hpp:17,
> from /usr/include/boost/thread.hpp:13,
> from test.cpp:1:
> /usr/include/boost/thread/locks.hpp: In member function
'boost::unique_lock<Mutex>&
boost::unique_lock<Mutex>::operator=(boost::unique_lock<Mutex>&&) [with
Mutex = boost::mutex, boost::unique_lock<Mutex> =
boost::unique_lock<boost::mutex>]':
> /usr/include/boost/thread/future.hpp:414:91: instantiated from here
> /usr/include/boost/thread/locks.hpp:269:13: error: cannot bind
'boost::unique_lock<boost::mutex>' lvalue to
'boost::unique_lock<boost::mutex>&&'
> /usr/include/boost/thread/locks.hpp:279:14: error: initializing
argument 1 of 'void
boost::unique_lock<Mutex>::swap(boost::unique_lock<Mutex>&&) [with Mutex =
boost::mutex, boost::unique_lock<Mutex> =
boost::unique_lock<boost::mutex>]'
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/3844#comment:3> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:03 UTC