Boost C++ Libraries: Ticket #7033: SolarisStudio 12.3 bug: doesn't like intrusive::detail::type_has_rebind::test() declarations https://svn.boost.org/trac10/ticket/7033 <p> With (unpatched) <a class="missing wiki">SolarisStudio</a> 12.3 </p> <pre class="wiki">CC -V CC: Sun C++ 5.12 SunOS_i386 2011/11/16 </pre><p> This: </p> <pre class="wiki">#include &lt;boost/container/deque.hpp&gt; int main() { boost::container::deque&lt;int&gt; myDeque; return 0; } </pre><p> Fails to build: </p> <pre class="wiki">CC test.cpp -g -I/path/to/boost -library=stlport4 ir_build_type(): unexpected type </pre><p> Without -g gives the marginally more useful: </p> <pre class="wiki">CC test.cpp -I/path/to/boost -I/opt/csw/include -library=stlport4 "include/boost/container/deque.hpp", line 487: Error: Cannot use int to initialize boost::container::allocator_traits&lt;std::allocator&lt;std::allocator&lt;void&gt;::_Tp1&gt;&gt;::pointer. "include/boost/container/deque.hpp", line 387: Where: While instantiating "boost::container::deque_base&lt;int, std::allocator&lt;int&gt;&gt;::members_holder::members_holder()". "include/boost/container/deque.hpp", line 387: Where: Instantiated from boost::container::deque_base&lt;int, std::allocator&lt;int&gt;&gt;::deque_base(). "include/boost/container/deque.hpp", line 837: Where: Instantiated from boost::container::deque&lt;int, std::allocator&lt;int&gt;&gt;::deque(). "test.cpp", line 5: Where: Instantiated from non-template code. 1 Error(s) detected. </pre><p> Took some time to track down, but it appears the compiler is unhappy with the test() declarations in type_has_rebind and type_has_rebind_other from intrusive/detail/memory_util.hpp. Removing the template keyword (e.g. static char test(int, typename X::rebind&lt;T&gt;*); ) allows successful compilation, but with a warning about the missing template, which is somewhat amusing! </p> <pre class="wiki">CC test.cpp -g -I/path/to/boost -library=stlport4 "include/boost/intrusive/detail/memory_util.hpp", line 188: Warning (Anachronism): Using rebind as a template without a declaration. "include/boost/intrusive/detail/memory_util.hpp", line 216: Where: While specializing "boost::intrusive::detail::type_has_rebind&lt;std::allocator&lt;int&gt;, int*&gt;". "include/boost/intrusive/detail/memory_util.hpp", line 216: Where: Specialized in boost::intrusive::detail::type_rebind_mode&lt;std::allocator&lt;int&gt;, int*&gt;. "include/boost/intrusive/detail/memory_util.hpp", line 224: Where: Specialized in boost::container::allocator_traits&lt;std::allocator&lt;int&gt;&gt;::portable_rebind_alloc&lt;int*&gt;. "include/boost/container/deque.hpp", line 113: Where: Specialized in boost::container::deque_base&lt;int, std::allocator&lt;int&gt;&gt;. "include/boost/container/deque.hpp", line 533: Where: Specialized in boost::container::deque&lt;int, std::allocator&lt;int&gt;&gt;. "test.cpp", line 5: Where: Specialized in non-template code. "include/boost/intrusive/detail/memory_util.hpp", line 204: Warning (Anachronism): Using rebind as a template without a declaration. "include/boost/intrusive/detail/memory_util.hpp", line 217: Where: While specializing "boost::intrusive::detail::type_has_rebind_other&lt;std::allocator&lt;int&gt;, int*&gt;". "include/boost/intrusive/detail/memory_util.hpp", line 217: Where: Specialized in boost::intrusive::detail::type_rebind_mode&lt;std::allocator&lt;int&gt;, int*&gt;. "include/boost/intrusive/detail/memory_util.hpp", line 224: Where: Specialized in boost::container::allocator_traits&lt;std::allocator&lt;int&gt;&gt;::portable_rebind_alloc&lt;int*&gt;. "include/boost/container/deque.hpp", line 113: Where: Specialized in boost::container::deque_base&lt;int, std::allocator&lt;int&gt;&gt;. "include/boost/container/deque.hpp", line 533: Where: Specialized in boost::container::deque&lt;int, std::allocator&lt;int&gt;&gt;. "test.cpp", line 5: Where: Specialized in non-template code. "include/boost/container/allocator/allocator_traits.hpp", line 234: Warning: The variable flag has not yet been assigned a value. 3 Warning(s) detected. </pre><p> I've attached the patch I'm using (against 1.49.0) in case it's of any interest. I also noticed that test() declarations are in type_rebind_mode but appear to be unused - the patch also removes those. </p> <p> Sadly I don't have an Oracle support contract so probably can't do much about reporting the compiler problem at the moment. </p> <p> Regards </p> <p> Luke Elliott. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7033 Trac 1.4.3 lukester_null@… Wed, 27 Jun 2012 10:01:34 GMT attachment set https://svn.boost.org/trac10/ticket/7033 https://svn.boost.org/trac10/ticket/7033 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">memory_util.patch</span> </li> </ul> Ticket Ion Gaztañaga Thu, 12 Jul 2012 07:48:13 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7033#comment:1 https://svn.boost.org/trac10/ticket/7033#comment:1 <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> Thanks for the report. I don't have access to Sun compiler and I'm afraid is not standard conforming enough in many cases. Anyway, I applied your patch in trunk at revision: 79437 </p> Ticket lukester_null@… Fri, 13 Jul 2012 17:30:26 GMT <link>https://svn.boost.org/trac10/ticket/7033#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7033#comment:2</guid> <description> <p> Yes it certainly can be a struggle! Anyway, thanks. When there's a new version of the compiler available I'll try to remember to try this without the patch and report if there's any change... </p> </description> <category>Ticket</category> </item> </channel> </rss>