mini-c example does not compile (msvc2015, win32, boost 1.63)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

mini-c example does not compile (msvc2015, win32, boost 1.63)

Frank Hein
Hello,

compiling the qi mini_c example I get the error:

c:\_lib\boost\boost\phoenix\function\detail\cpp03\preprocessed\function_operator_10.hpp(57):

error C2664:
'boost::phoenix::actor<boost::proto::exprns_::basic_expr<Tag,Args,4>>
                boost::phoenix::expr_ext<boost::phoenix::actor,Tag,H,char
*,boost::phoenix::actor<boost::spirit::argument<3>>
 ,boost::phoenix::actor<boost::spirit::argument<2>>>::make(const
client::error_handler<Iterator> &
                ,char *const ,const
boost::phoenix::actor<boost::spirit::argument<3>> &
                ,const boost::phoenix::actor<boost::spirit::argument<2>>
&)'
: cannot convert argument 2 from 'const char [18]' to 'char *const '

Origin of this error are the error handling lines. Here the one from
expression_def.hpp

///////////////////////////////////////////////////////////////////////
// Error handling: on error in expr, call error_handler.
        on_error<fail>(expr,
            error_handler_function(error_handler)(
                "Error! Expecting ", _4, _3));

Any help to have that fixed would be highly appreciated.
I implemented error_handling in several parser copying from mini_c.

Those do not compile any longer, too.

Regards, Frank

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: mini-c example does not compile (msvc2015, win32, boost 1.63)

sehe
On 04-03-17 04:30, Frank Hein wrote:
> ///////////////////////////////////////////////////////////////////////
> // Error handling: on error in expr, call error_handler.
>         on_error<fail>(expr,
>             error_handler_function(error_handler)(
>                 "Error! Expecting ", _4, _3));

Suggestions:


 - spell it `+"Error! Expecting "` so that you explicitly decay  it
before it gets forwarded

 - use `boost::phoenix::val("Error! Expecting ")` to explicitly lift the
expression to a phoenix actor




------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: mini-c example does not compile (msvc2015, win32, boost 1.63)

Frank Hein
Seth <[hidden email]> wrote on 04.03.2017 16:02:08:

> From: Seth <[hidden email]>
> To: Spirit General Mailing List <[hidden email]>
> Date: 04.03.2017 16:03
> Subject: Re: [Spirit-general] mini-c example does not compile
> (msvc2015, win32, boost 1.63)
>
> On 04-03-17 04:30, Frank Hein wrote:
> >
///////////////////////////////////////////////////////////////////////

> > // Error handling: on error in expr, call error_handler.
> >         on_error<fail>(expr,
> >             error_handler_function(error_handler)(
> >                 "Error! Expecting ", _4, _3));
>
> Suggestions:
>
>
>  - spell it `+"Error! Expecting "` so that you explicitly decay  it
> before it gets forwarded
>
>  - use `boost::phoenix::val("Error! Expecting ")` to explicitly lift the
> expression to a phoenix actor
>
>
Thanks. Or just
std::string msg = "Error! Expecting ";
   on_error<fail>(expr,
   error_handler_function(error_handler)(
       msg, _4, _3));

I can confirm that this issue was introduced with MSVC 2015. 2013, 2012,
2010
and 2008 do not complain.
 

>
>
>
------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> Spirit-general mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/spirit-general
>

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Loading...