Opened 6 years ago

#12493 new Bugs

Compile error in boost::intrusive with Sun compiler 12.4

Reported by: kilian.kilger@… Owned by: Ion Gaztañaga
Milestone: To Be Determined Component: intrusive
Version: Boost 1.58.0 Severity: Problem
Keywords: Cc:

Description

When trying to compile the unit tests in boost::container, I get compile errors in boost/intrusive/detail/to_raw_pointer.hpp on Sun with the 12.4 Sun Studio compiler in non-C++11 mode when using the ancient STLport 4.5.

"/boost/intrusive/detail/to_raw_pointer.hpp", line 41: Error: Variable p of type void*const is not a structure. "/boost/container/detail/multiallocation_chain.hpp", line 66: Where, temwhileinst: While instantiating "boost::intrusive::detail::to_raw_pointer<void*>(void*const&)". "/boost/boost/container/detail/multiallocation_chain.hpp", line 66: Where, teminstend: Instantiated from non-template code.

For me it seems that the Sun compiler picks the wrong overload here. Why is the code there not "disambiguated" via boost::enable_if?

The following code seems to work:

template<class Pointer> inline typename boost::intrusive::pointer_element<Pointer>::type* to_raw_pointer(const Pointer &p, typename boost::disable_if<boost::is_pointer<Pointer> >::type * = 0) { ... }

At least, the unit tests are running.

The code in this file did not change in this regards in Boost 1.61.

Change History (0)

Note: See TracTickets for help on using tickets.