id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 7033,SolarisStudio 12.3 bug: doesn't like intrusive::detail::type_has_rebind::test() declarations,anonymous,Ion Gaztañaga,"With (unpatched) SolarisStudio 12.3 {{{ CC -V CC: Sun C++ 5.12 SunOS_i386 2011/11/16 }}} This: {{{ #include int main() { boost::container::deque myDeque; return 0; } }}} Fails to build: {{{ CC test.cpp -g -I/path/to/boost -library=stlport4 ir_build_type(): unexpected type }}} Without -g gives the marginally more useful: {{{ 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::_Tp1>>::pointer. ""include/boost/container/deque.hpp"", line 387: Where: While instantiating ""boost::container::deque_base>::members_holder::members_holder()"". ""include/boost/container/deque.hpp"", line 387: Where: Instantiated from boost::container::deque_base>::deque_base(). ""include/boost/container/deque.hpp"", line 837: Where: Instantiated from boost::container::deque>::deque(). ""test.cpp"", line 5: Where: Instantiated from non-template code. 1 Error(s) detected. }}} 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*); ) allows successful compilation, but with a warning about the missing template, which is somewhat amusing! {{{ 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, int*>"". ""include/boost/intrusive/detail/memory_util.hpp"", line 216: Where: Specialized in boost::intrusive::detail::type_rebind_mode, int*>. ""include/boost/intrusive/detail/memory_util.hpp"", line 224: Where: Specialized in boost::container::allocator_traits>::portable_rebind_alloc. ""include/boost/container/deque.hpp"", line 113: Where: Specialized in boost::container::deque_base>. ""include/boost/container/deque.hpp"", line 533: Where: Specialized in boost::container::deque>. ""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, int*>"". ""include/boost/intrusive/detail/memory_util.hpp"", line 217: Where: Specialized in boost::intrusive::detail::type_rebind_mode, int*>. ""include/boost/intrusive/detail/memory_util.hpp"", line 224: Where: Specialized in boost::container::allocator_traits>::portable_rebind_alloc. ""include/boost/container/deque.hpp"", line 113: Where: Specialized in boost::container::deque_base>. ""include/boost/container/deque.hpp"", line 533: Where: Specialized in boost::container::deque>. ""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. }}} 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. Sadly I don't have an Oracle support contract so probably can't do much about reporting the compiler problem at the moment. Regards Luke Elliott. ",Patches,closed,To Be Determined,intrusive,Boost 1.49.0,Problem,fixed,,