From ff6d082918c5d3cc0385849204bda62cb5b2f806 Mon Sep 17 00:00:00 2001 From: Aleksey Gurtovoy Date: Sun, 5 Sep 2004 09:08:26 +0000 Subject: [PATCH] fix GCC regression [SVN r24911] --- include/boost/mpl/assert.hpp | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/include/boost/mpl/assert.hpp b/include/boost/mpl/assert.hpp index 86f19ae..258522d 100644 --- a/include/boost/mpl/assert.hpp +++ b/include/boost/mpl/assert.hpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -45,9 +46,16 @@ BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN struct failed {}; // agurt, 24/aug/04: MSVC 7.1 workaround here and below: return/accept -// 'assert' by reference +// 'assert' by reference; can't apply it unconditionally -- apparently it +// degrades quality of GCC diagnostics +#if BOOST_WORKAROUND(BOOST_MSVC, == 1310) +# define AUX778076_ASSERT_ARG(x) x& +#else +# define AUX778076_ASSERT_ARG(x) x +#endif + template< bool C > struct assert { typedef void* type; }; -template<> struct assert { typedef assert& type; }; +template<> struct assert { typedef AUX778076_ASSERT_ARG(assert) type; }; template< bool C > int assertion_failed( typename assert::type ); @@ -122,11 +130,11 @@ failed ************ (boost::mpl::not_::************ ); template< typename Pred > -assert& +AUX778076_ASSERT_ARG(assert) assert_arg( void (*)(Pred), typename assert_arg_pred_not::type ); template< typename Pred > -assert& +AUX778076_ASSERT_ARG(assert) assert_not_arg( void (*)(Pred), typename assert_arg_pred::type ); @@ -140,7 +148,7 @@ template< bool c, typename Pred > struct assert_arg_type_impl template< typename Pred > struct assert_arg_type_impl { - typedef assert& type; + typedef AUX778076_ASSERT_ARG(assert) type; }; template< typename Pred > struct assert_arg_type @@ -166,7 +174,9 @@ typename assert_arg_type_impl< false,assert_relation >::type assert_rel_arg( assert_relation ); # endif -#endif +#endif // BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER + +#undef AUX778076_ASSERT_ARG BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE