Opened 14 years ago
Closed 13 years ago
#2602 closed Bugs (fixed)
Error, inaccessible: boost::thread::thread(boost::thread&) is not accessible from ...
Reported by: | Owned by: | Anthony Williams | |
---|---|---|---|
Milestone: | Boost 1.38.0 | Component: | thread |
Version: | Boost 1.37.0 | Severity: | Problem |
Keywords: | Cc: | jwakely.boost@… |
Description
Error while compiling boost 1.37 libraries in Sun Solaris 10. Here's the Sun Studio Forums post:
http://forums.sun.com/thread.jspa?messageID=10502674#10502674
Attachments (2)
Change History (6)
comment:1 by , 14 years ago
Cc: | added |
---|
by , 14 years ago
Attachment: | boost_thread_move.patch added |
---|
partial fix for move semantics with Sun compiler
comment:2 by , 14 years ago
IMHO the patch is an improvement, as it allows explicit moves from lvalues, even though it doesn't help with implicit moves from rvalues (because you can't create a boost::thread rvalue with the Sun compiler.)
Looking into the unique_lock test failures (which don't cause a failure when building libboost_thread because there's no locks.cpp) I tried to find boost::move() for unique_lock, but it seems to only be defined in when BOOST_HAS_RVALUE_REFS, is that right?
#ifdef BOOST_HAS_RVALUE_REFS template<typename Mutex> inline unique_lock<Mutex>&& move(unique_lock<Mutex>&& ul) { return ul; } #endif
Should there be a #else ?
by , 13 years ago
Attachment: | thread.patch added |
---|
comment:3 by , 13 years ago
The compiler doesn't seem to actually call the constructor. As far as I can tell, it just requires it to exist. So, there seem to be two options, we can get a compile time error when copying a non-const thread, and a link error when copying a const thread or vice-versa. The attached patch, thread.patch, takes the alternative of making copying a non-const thread a compile time error. All the tests pass for me.
bash-3.2.$ CC -V CC: Sin C++ 5.9 SunOS_i386 2007/11/15
comment:4 by , 13 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Fixed on trunk (revision 53385)
This is still present in 1.38.0_beta2
I managed to work around (patch follows) but now
test_move_function.cpp
fails with similar errors, because some of the tests hit the same bug (failure to implicitly convert tothread_move_t
and back)