Merge pull request #127 from Flast/workaround/for-older-gcc

Workaround for ICE on GCC 4.0/4.1.
This commit is contained in:
Joel de Guzman
2016-03-08 16:26:56 +08:00
2 changed files with 19 additions and 5 deletions

View File

@ -8,6 +8,7 @@
#define BOOST_FUSION_SEGMENTED_ITERATOR_RANGE_HPP_INCLUDED #define BOOST_FUSION_SEGMENTED_ITERATOR_RANGE_HPP_INCLUDED
#include <boost/fusion/support/config.hpp> #include <boost/fusion/support/config.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/mpl/assert.hpp> #include <boost/mpl/assert.hpp>
#include <boost/type_traits/add_const.hpp> #include <boost/type_traits/add_const.hpp>
#include <boost/type_traits/remove_reference.hpp> #include <boost/type_traits/remove_reference.hpp>
@ -409,11 +410,14 @@ namespace boost { namespace fusion { namespace detail
template < template <
typename StackBegin typename StackBegin
, typename StackEnd , typename StackEnd
, bool SameSegment = , bool SameSegment
result_of::equal_to< #if BOOST_WORKAROUND(BOOST_GCC, < 40000) || BOOST_WORKAROUND(BOOST_GCC, >= 40200)
= result_of::equal_to<
typename StackBegin::car_type::begin_type typename StackBegin::car_type::begin_type
, typename StackEnd::car_type::begin_type , typename StackEnd::car_type::begin_type
>::type::value> >::type::value
#endif
>
struct make_segmented_range_reduce2 struct make_segmented_range_reduce2
{ {
typedef typedef
@ -480,7 +484,14 @@ namespace boost { namespace fusion { namespace detail
template <typename StackBegin, typename StackEnd, int StackBeginSize, int StackEndSize> template <typename StackBegin, typename StackEnd, int StackBeginSize, int StackEndSize>
struct make_segmented_range_reduce struct make_segmented_range_reduce
: make_segmented_range_reduce2<StackBegin, StackEnd> : make_segmented_range_reduce2<StackBegin, StackEnd
#if BOOST_WORKAROUND(BOOST_GCC, >= 40000) || BOOST_WORKAROUND(BOOST_GCC, < 40200)
, result_of::equal_to<
typename StackBegin::car_type::begin_type
, typename StackEnd::car_type::begin_type
>::type::value
#endif
>
{}; {};
template <typename StackBegin, typename StackEnd> template <typename StackBegin, typename StackEnd>

View File

@ -39,7 +39,10 @@ namespace boost { namespace fusion
static type static type
call(Iterator const& i) call(Iterator const& i)
{ {
BOOST_STATIC_ASSERT((type::position::value < 2)); // Workaround for ICE on GCC 4.0.0.
// see https://svn.boost.org/trac/boost/ticket/5808
typedef typename type::position position;
BOOST_STATIC_ASSERT((position::value < 2));
return type(i.view); return type(i.view);
} }
}; };