[Boost-bugs] [Boost C++ Libraries] #3339: intrusive containers vs. Sun CC

Subject: [Boost-bugs] [Boost C++ Libraries] #3339: intrusive containers vs. Sun CC
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-08-13 13:02:54


#3339: intrusive containers vs. Sun CC
----------------------------------------------------+-----------------------
 Reporter: Christopher Hite <c.hite@…> | Owner: igaztanaga
     Type: Bugs | Status: new
Milestone: Boost 1.40.0 | Component: intrusive
  Version: Boost 1.39.0 | Severity: Problem
 Keywords: |
----------------------------------------------------+-----------------------
 Intrusive doesn't not work at all with SunCC. The regression tests were
 turned off.

 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.
 http://www.boost.org/doc/libs/1_39_0/boost/intrusive/detail/utilities.hpp

 {{{
 template <class T>
 struct internal_base_hook_bool
 {
    template<bool Add>
    struct two_or_three {one _[2 + Add];};
    template <class U> static one test(...);
    template <class U> static
    two_or_three<U::boost_intrusive_tags::is_base_hook>
       test (detail::bool_<U::boost_intrusive_tags::is_base_hook>* = 0);
    static const std::size_t value = sizeof(test<T>(0));
 };
 }}}

 On gcc it does what it's suppose to; value = [[BR]]
     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]]
 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:
 http://www.boost.org/doc/libs/1_38_0/boost/unordered/detail/move.hpp[[BR]]
 Note how they use a second test(int) function. This works fine on Sun CC!

 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?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3339>
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:01 UTC