Boost C++ Libraries: Ticket #3339: intrusive containers vs. Sun CC https://svn.boost.org/trac10/ticket/3339 <p> Intrusive doesn't not work at all with SunCC. The regression tests were turned off. </p> <p> I'm not sure if it fixes everything, but I was able debug some of the meta-programming and find a discrepancy between gcc and Sun CC which causes normal usage to break. <a href="http://www.boost.org/doc/libs/1_39_0/boost/intrusive/detail/utilities.hpp">http://www.boost.org/doc/libs/1_39_0/boost/intrusive/detail/utilities.hpp</a> </p> <pre class="wiki">template &lt;class T&gt; struct internal_base_hook_bool { template&lt;bool Add&gt; struct two_or_three {one _[2 + Add];}; template &lt;class U&gt; static one test(...); template &lt;class U&gt; static two_or_three&lt;U::boost_intrusive_tags::is_base_hook&gt; test (detail::bool_&lt;U::boost_intrusive_tags::is_base_hook&gt;* = 0); static const std::size_t value = sizeof(test&lt;T&gt;(0)); }; </pre><p> On gcc it does what it's suppose to; value = <br /> </p> <blockquote> <p> 1 - iff T has no boost_intrusive_tags::is_base_hook <br /> 2 - iff T::boost_intrusive_tags::is_base_hook=false <br /> 3 - iff T::boost_intrusive_tags::is_base_hook=true <br /> </p> </blockquote> <p> On Sun CC it's always 1. So this is a usage of SFINAE which doesn't seem to work on SunCC, but other examples do work just fine: class_has_move_assign here: <a href="http://www.boost.org/doc/libs/1_38_0/boost/unordered/detail/move.hpp[[BR">http://www.boost.org/doc/libs/1_38_0/boost/unordered/detail/move.hpp[[BR</a>]]  Note how they use a second test(int) function. This works fine on Sun CC! </p> <p> So I would suggest changing this in the few places in intrusive where SFINAE is used. Perhaps intrusive will then work on the latest Sun CC (which supposedly supports (mostly) MPL). Do you have a Sun environment to run the regression tests? </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/3339 Trac 1.4.3 Steven Watanabe Thu, 20 Aug 2009 13:17:23 GMT <link>https://svn.boost.org/trac10/ticket/3339#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3339#comment:1</guid> <description> <p> Can you </p> <ol class="loweralpha"><li>Make a patch </li><li>Run the regression tests. </li></ol><p> To run the regression tests manually use </p> <pre class="wiki">cd libs/intrisuve/test bjam toolset=sun </pre> </description> <category>Ticket</category> </item> <item> <author>Christopher Hite <c.hite@…></author> <pubDate>Mon, 24 Aug 2009 17:52:34 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3339#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3339#comment:2</guid> <description> <p> I did the fix I suggested and libs/intrisuve/test looks a little better ...failed updating 19 targets... went to: ...failed updating 16 targets... </p> <p> <a class="ext-link" href="https://svn.boost.org/svn/boost/sandbox-branches/intrusive_fix_SunCC"><span class="icon">​</span>https://svn.boost.org/svn/boost/sandbox-branches/intrusive_fix_SunCC</a> revision 55765 </p> <p> The reason all the other tests fail is that they test the class twice once with normal pointers and once with a test smart_pointer class which resembles interprocess::pointer. Issues with this test class seem to still break on Sun CC. I don't really care in my application. It would be nice if I could show the tests for the individual classes worked. </p> <p> Could we merge my very small changes into the trunk? </p> <p> Do I need to continue and fix the smart pointer test? Does anyone care? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Mon, 24 Aug 2009 19:25:43 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3339#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3339#comment:3</guid> <description> <p> Can you show us the patch? </p> </description> <category>Ticket</category> </item> <item> <author>Christopher Hite <c.hite@…></author> <pubDate>Tue, 25 Aug 2009 08:33:54 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3339#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3339#comment:4</guid> <description> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/55765" title="fixed SFINAE usage for Sun CC">r55765</a> - sorry hadn't read Trac Links page. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Tue, 25 Aug 2009 10:58:11 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3339#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3339#comment:5</guid> <description> <p> The patch: </p> <p> <a class="ext-link" href="https://svn.boost.org/trac/boost/changeset?old_path=%2F&amp;old=55764&amp;new_path=%2F&amp;new=55765"><span class="icon">​</span>https://svn.boost.org/trac/boost/changeset?old_path=%2F&amp;old=55764&amp;new_path=%2F&amp;new=55765</a> </p> <p> seems ok. Please commit, but it would nice if you could also fix other test cases. </p> </description> <category>Ticket</category> </item> <item> <author>Christopher Hite <c.hite@…></author> <pubDate>Tue, 25 Aug 2009 13:04:13 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/3339#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/3339#comment:6</guid> <description> <p> Sorry, I don't think I have privileges to touch the trunk. I only asked for a sandbox account. </p> <p> <a class="changeset" href="https://svn.boost.org/trac10/changeset/55775" title="removed explicit from smart_ptr ctor">r55775</a> - I was able to fix the test code! After removing explicit from smart_ptr's constructor everything works fine. All tests pass on my version of Sun CC. <br /> CC: Sun C++ 5.9 SunOS_i386 Patch 124864-12 2009/04/21 </p> <p> I kind of think Sun CC is right to complain about this: </p> <pre class="wiki">".../boost/intrusive/sgtree.hpp", line 390: Error: Formal argument header of type boost::intrusive::smart_ptr&lt;boost::intrusive::tree_node&lt;boost::intrusive::smart_ptr&lt;void&gt;&gt;&gt; in call to static boost::intrusive::sgtree_algorithms&lt;boost::intrusive::tree_node_traits&lt;boost::intrusive::smart_ptr&lt;void&gt;&gt;&gt;::init_header( boost::intrusive::smart_ptr&lt;boost::intrusive::tree_node&lt;boost::intrusive::smart_ptr&lt;void&gt;&gt;&gt;) is being passed boost::intrusive::tree_node&lt;boost::intrusive::smart_ptr&lt;void&gt;&gt;* </pre><p> You are converting node* to node_ptr implicitly in that call. I can't figure out why gcc allows this. You'd think it'd be the second "template &lt;class T&gt; smart_ptr(T *ptr)", but commenting that doesn't keep gcc from compiling. </p> <p> 1) So please review this other tiny one line change and let me know it's all good.<br /> </p> <p> 2) Please do the merging or let me know if I can.<br /> </p> <p> 3) Someone needs to turn these tests back on for Sun 5.9. You may need to upgrade it from 2007/05/03 to something this year.<br /> <a href="http://www.boost.org/development/tests/trunk/Sandia-sun.html">http://www.boost.org/development/tests/trunk/Sandia-sun.html</a> </p> </description> <category>Ticket</category> </item> <item> <author>Christopher Hite <c.hite@…></author> <pubDate>Wed, 26 Aug 2009 09:07:48 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/3339#comment:7 https://svn.boost.org/trac10/ticket/3339#comment:7 <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> 1-2: You can forget about. I merged the changes to trunk (<a class="changeset" href="https://svn.boost.org/trac10/changeset/55784" title="merged sandbox-branches/intrusive_fix_SunCC (r55765 and r55775) fixing ...">r55784</a>). </p> <p> 3: I'll ask the list about. </p> Ticket