Subject: [Boost-bugs] [Boost C++ Libraries] #7033: SolarisStudio 12.3 bug: doesn't like intrusive::detail::type_has_rebind::test() declarations
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2012-06-27 10:01:07
#7033: SolarisStudio 12.3 bug: doesn't like
intrusive::detail::type_has_rebind::test() declarations
------------------------------+---------------------------------------------
Reporter: anonymous | Owner: igaztanaga
Type: Patches | Status: new
Milestone: To Be Determined | Component: intrusive
Version: Boost 1.49.0 | Severity: Problem
Keywords: |
------------------------------+---------------------------------------------
With (unpatched) SolarisStudio 12.3
{{{
CC -V
CC: Sun C++ 5.12 SunOS_i386 2011/11/16
}}}
This:
{{{
#include <boost/container/deque.hpp>
int main()
{
boost::container::deque<int> 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<std::allocator<std::allocator<void>::_Tp1>>::pointer.
"include/boost/container/deque.hpp", line 387: Where: While
instantiating "boost::container::deque_base<int,
std::allocator<int>>::members_holder::members_holder()".
"include/boost/container/deque.hpp", line 387: Where: Instantiated
from boost::container::deque_base<int, std::allocator<int>>::deque_base().
"include/boost/container/deque.hpp", line 837: Where: Instantiated
from boost::container::deque<int, std::allocator<int>>::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<T>*); ) 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<std::allocator<int>, int*>".
"include/boost/intrusive/detail/memory_util.hpp", line 216: Where:
Specialized in
boost::intrusive::detail::type_rebind_mode<std::allocator<int>, int*>.
"include/boost/intrusive/detail/memory_util.hpp", line 224: Where:
Specialized in
boost::container::allocator_traits<std::allocator<int>>::portable_rebind_alloc<int*>.
"include/boost/container/deque.hpp", line 113: Where: Specialized in
boost::container::deque_base<int, std::allocator<int>>.
"include/boost/container/deque.hpp", line 533: Where: Specialized in
boost::container::deque<int, std::allocator<int>>.
"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<std::allocator<int>,
int*>".
"include/boost/intrusive/detail/memory_util.hpp", line 217: Where:
Specialized in
boost::intrusive::detail::type_rebind_mode<std::allocator<int>, int*>.
"include/boost/intrusive/detail/memory_util.hpp", line 224: Where:
Specialized in
boost::container::allocator_traits<std::allocator<int>>::portable_rebind_alloc<int*>.
"include/boost/container/deque.hpp", line 113: Where: Specialized in
boost::container::deque_base<int, std::allocator<int>>.
"include/boost/container/deque.hpp", line 533: Where: Specialized in
boost::container::deque<int, std::allocator<int>>.
"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.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/7033> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:09 UTC