Hi,

I recently run into an ICE by compiling phoenix3 with gcc-4.2. It seems this 
particular can not handle proto::detail::poly_function_traits properly.
the problem is the default Switch template initialization ... by replacing 
std::size_t Switch = sizeof(test_poly_function<Fun>(0,0)) by typename Switch 
= mpl::size_t<sizeof(test_poly_function<Fun>(0,0))> the ICE is gone (the 
specialisations are adapted as well.
The patch is attached.

Best regards,
Thomas
Index: boost/proto/detail/poly_function.hpp
===================================================================
--- boost/proto/detail/poly_function.hpp	(revision 67425)
+++ boost/proto/detail/poly_function.hpp	(working copy)
@@ -15,6 +15,7 @@
     #include <boost/ref.hpp>
     #include <boost/mpl/bool.hpp>
     #include <boost/mpl/void.hpp>
+    #include <boost/mpl/size_t.hpp>
     #include <boost/mpl/eval_if.hpp>
     #include <boost/preprocessor/cat.hpp>
     #include <boost/preprocessor/facilities/intercept.hpp>
@@ -185,7 +186,7 @@
         template<typename T> unknown_function_t test_poly_function(T *, ...);
 
         ////////////////////////////////////////////////////////////////////////////////////////////////
-        template<typename Fun, typename Sig, std::size_t Switch = sizeof(test_poly_function<Fun>(0,0))>
+        template<typename Fun, typename Sig, typename Switch = mpl::size_t<sizeof(test_poly_function<Fun>(0,0))> >
         struct poly_function_traits
         {
             typedef typename Fun::template result<Sig>::type result_type;
@@ -194,7 +195,7 @@
 
         ////////////////////////////////////////////////////////////////////////////////////////////////
         template<typename Fun, typename Sig>
-        struct poly_function_traits<Fun, Sig, sizeof(mono_function_t)>
+        struct poly_function_traits<Fun, Sig, mpl::size_t<sizeof(mono_function_t)> >
         {
             typedef typename Fun::result_type result_type;
             typedef Fun function_type;
@@ -265,7 +266,7 @@
 
         ////////////////////////////////////////////////////////////////////////////////////////////////
         template<typename PolyFun BOOST_PP_ENUM_TRAILING_PARAMS(N, typename A)>
-        struct poly_function_traits<PolyFun, PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), sizeof(poly_function_t)>
+        struct poly_function_traits<PolyFun, PolyFun(BOOST_PP_ENUM_PARAMS(N, A)), mpl::size_t<sizeof(poly_function_t)> >
         {
             typedef typename PolyFun::template impl<BOOST_PP_ENUM_PARAMS(N, const A)> function_type;
             typedef typename function_type::result_type result_type;
_______________________________________________
proto mailing list
proto@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/proto

Reply via email to