
On Nov 25, 2005, at 6:27 PM, Hartmut Kaiser wrote:
Douglas Gregor wrote:
GCC 4.0.2 is failing on some of the "switch" tests for Spirit. Would one of the Spirit developer please take a look at these? I'd like to get full support for GCC 4.0.2 into 1.33.1, if possible.
http://engineering.meta-comm.com/boost-regression/CVS-RC_1_33_ 0/developer/spirit.html
I hope to have it fixed (can't verify, though, don't have gcc 4.0.2 available at the moment). Let's wait for the next regression tests.
I've managed to fix it with this patch, but I'd like you to check it over before I commit it to CVS. Basically, I'm just casting the value in the "case" statements into a "long". It seems safe, since we've already forced cond_value to be a long. Doug Index: switch.ipp =================================================================== RCS file: /cvsroot/boost/boost/boost/spirit/dynamic/impl/switch.ipp,v retrieving revision 1.10.6.1 diff -u -r1.10.6.1 switch.ipp --- switch.ipp 25 Nov 2005 23:25:57 -0000 1.10.6.1 +++ switch.ipp 28 Nov 2005 12:22:25 -0000 @@ -385,7 +385,7 @@ /**/ #define BOOST_SPIRIT_PARSE_SWITCH_CASES(z, N, _) \ - case BOOST_PP_CAT(left_t, N)::value: \ + case (long)(BOOST_PP_CAT(left_t, N)::value): \ return delegate_parse(chain_parser<N, left_t1>::right(p.left()), \ scan, save); \ /**/ @@ -404,7 +404,7 @@ BOOST_SPIRIT_PARSE_SWITCH_TYPEDEFS, _) \ \ switch (cond_value) { \ - case BOOST_PP_CAT(left_t, BOOST_PP_INC(N))::value: \ + case (long)(BOOST_PP_CAT(left_t, BOOST_PP_INC(N))::value): \ return delegate_parse( \ chain_parser< \ case_chain<ParserT>::depth, ParserT \ @@ -413,7 +413,7 @@ BOOST_PP_REPEAT_FROM_TO_ ## z(1, BOOST_PP_INC(N), \ BOOST_SPIRIT_PARSE_SWITCH_CASES, _) \ \ - case left_t0::value: \ + case (long)(left_t0::value): \ default: \ typedef default_case<ParserT> default_t; \ typedef \