Boost C++ Libraries: Ticket #2602: Error, inaccessible: boost::thread::thread(boost::thread&) is not accessible from ... https://svn.boost.org/trac10/ticket/2602 <p> Error while compiling boost 1.37 libraries in Sun Solaris 10. Here's the Sun Studio Forums post: </p> <p> <a class="ext-link" href="http://forums.sun.com/thread.jspa?messageID=10502674#10502674"><span class="icon">​</span>http://forums.sun.com/thread.jspa?messageID=10502674#10502674</a> </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2602 Trac 1.4.3 Jonathan Wakely <jwakely.boost@…> Wed, 04 Feb 2009 11:44:21 GMT cc set https://svn.boost.org/trac10/ticket/2602#comment:1 https://svn.boost.org/trac10/ticket/2602#comment:1 <ul> <li><strong>cc</strong> <span class="trac-author">jwakely.boost@…</span> added </li> </ul> <p> This is still present in 1.38.0_beta2 </p> <p> I managed to work around (patch follows) but now <code>test_move_function.cpp</code> fails with similar errors, because some of the tests hit the same bug (failure to implicitly convert to <code>thread_move_t</code> and back) </p> <pre class="wiki">sun.compile.c++ ../../../bin.v2/libs/thread/test/test_move_function_lib.test/sun-5.9/debug/threading-multi/test_move_function.o "test_move_function.cpp", line 38: Error, inaccessible: boost::thread::thread(boost::thread&amp;) is not accessible from start_thread(). "test_move_function.cpp", line 43: Error, inaccessible: boost::thread::thread(boost::thread&amp;) is not accessible from test_thread_move_from_rvalue_on_construction(). "test_move_function.cpp", line 62: Error, inaccessible: boost::unique_lock&lt;boost::mutex&gt;::unique_lock(boost::unique_lock&lt;boost::mutex&gt;&amp;) is not accessible from test_unique_lock_move_from_lvalue_on_construction(). "test_move_function.cpp", line 71: Error, inaccessible: boost::unique_lock&lt;boost::mutex&gt;::unique_lock(boost::unique_lock&lt;boost::mutex&gt;&amp;) is not accessible from get_lock(boost::mutex&amp;). "test_move_function.cpp", line 78: Error, inaccessible: boost::unique_lock&lt;boost::mutex&gt;::unique_lock(boost::unique_lock&lt;boost::mutex&gt;&amp;) is not accessible from test_unique_lock_move_from_rvalue_on_construction(). 5 Error(s) detected. </pre> Ticket Jonathan Wakely <jwakely.boost@…> Wed, 04 Feb 2009 11:46:37 GMT attachment set https://svn.boost.org/trac10/ticket/2602 https://svn.boost.org/trac10/ticket/2602 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">boost_thread_move.patch</span> </li> </ul> <p> partial fix for move semantics with Sun compiler </p> Ticket Jonathan Wakely <jwakely.boost@…> Wed, 04 Feb 2009 12:23:53 GMT <link>https://svn.boost.org/trac10/ticket/2602#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2602#comment:2</guid> <description> <p> 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.) </p> <p> 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? </p> <pre class="wiki">#ifdef BOOST_HAS_RVALUE_REFS template&lt;typename Mutex&gt; inline unique_lock&lt;Mutex&gt;&amp;&amp; move(unique_lock&lt;Mutex&gt;&amp;&amp; ul) { return ul; } #endif </pre><p> Should there be a #else ? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Steven Watanabe</dc:creator> <pubDate>Mon, 18 May 2009 00:15:16 GMT</pubDate> <title>attachment set https://svn.boost.org/trac10/ticket/2602 https://svn.boost.org/trac10/ticket/2602 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">thread.patch</span> </li> </ul> Ticket Steven Watanabe Mon, 18 May 2009 00:18:32 GMT <link>https://svn.boost.org/trac10/ticket/2602#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2602#comment:3</guid> <description> <p> 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, <a class="attachment" href="https://svn.boost.org/trac10/attachment/ticket/2602/thread.patch" title="Attachment 'thread.patch' in Ticket #2602">thread.patch</a><a class="trac-rawlink" href="https://svn.boost.org/trac10/raw-attachment/ticket/2602/thread.patch" title="Download">​</a>, takes the alternative of making copying a non-const thread a compile time error. All the tests pass for me. </p> <pre class="wiki">bash-3.2.$ CC -V CC: Sin C++ 5.9 SunOS_i386 2007/11/15 </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Anthony Williams</dc:creator> <pubDate>Fri, 29 May 2009 09:57:51 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2602#comment:4 https://svn.boost.org/trac10/ticket/2602#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Fixed on trunk (revision 53385) </p> Ticket