Operator mod-equal does not compile anymore?

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Operator mod-equal does not compile anymore?

Johannes Lorenz
Hello,

I have code that builds up a tree like in the old calc2 examples. The code worked good with boost 1.54 + clang 3.4, but I get one error with 1.56/3.6:

    error: no viable overloaded '%=' (no more explanations than that)
    code: ('%' >> factor          [_val %= _1])

However, it works perfectly for += etc. My full code is here [1]. If you prefer a minimal example, use the sum.cpp example [2] and replace += by %=, you'll get tons of (different) errors.

Any idea how to fix this?

Many thanks on advance.
- Johannes

[1] https://github.com/JohannesLorenz/sca-toolsuite/blob/master/src/res/eqs_internal.h
[2] http://www.boost.org/doc/libs/1_56_0/libs/spirit/example/qi/sum.cpp

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: Operator mod-equal does not compile anymore?

Goran

Maybe a bug in the libs. Update to 1.56 and see if it happens again.

Regards

[send by mobile device]

Am 02.10.2014 10:24 schrieb "Johannes Lorenz" <[hidden email]>:
Hello,

I have code that builds up a tree like in the old calc2 examples. The code worked good with boost 1.54 + clang 3.4, but I get one error with 1.56/3.6:

    error: no viable overloaded '%=' (no more explanations than that)
    code: ('%' >> factor          [_val %= _1])

However, it works perfectly for += etc. My full code is here [1]. If you prefer a minimal example, use the sum.cpp example [2] and replace += by %=, you'll get tons of (different) errors.

Any idea how to fix this?

Many thanks on advance.
- Johannes

[1] https://github.com/JohannesLorenz/sca-toolsuite/blob/master/src/res/eqs_internal.h
[2] http://www.boost.org/doc/libs/1_56_0/libs/spirit/example/qi/sum.cpp

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: Operator mod-equal does not compile anymore?

Johannes Lorenz
In reply to this post by Johannes Lorenz
> Maybe a bug in the libs. Update to 1.56 and see if it happens again.

As I wrote before, the bugs does occur in 1.56 (not in 1.54).

Also, I now recall that I have seen %= in another context for defining rules [3]. Maybe this conflicts with my custom %=-operator?

[3] http://stackoverflow.com/questions/24219969/implementing-operator-precedence-with-boost-spirit

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: Operator mod-equal does not compile anymore?

Johannes Lorenz
In reply to this post by Johannes Lorenz
Also, I just managed to get a more detailed error using g++ 4.9.1:

  error: no match for 'operator%=' (operand types are 'const _val_type {aka const boost::phoenix::actor<boost::spirit::attribute<0> >}' and 'const _1_type {aka const boost::phoenix::actor<boost::spirit::argument<0> >}')

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: Operator mod-equal does not compile anymore?

sehe
In reply to this post by Goran
On 02-10-14 11:37, Goran wrote:
>
>     error: no viable overloaded '%=' (no more explanations than that)
>     code: ('%' >> factor          [_val %= _1])
Have you included `boost/spirit/include/phoenix_operator.hpp`?

If so, try defining

     #define BOOST_SPIRIT_USE_PHOENIX_V3

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: Operator mod-equal does not compile anymore?

sehe
In reply to this post by Goran
On 02-10-14 11:37, Goran wrote:
> Maybe a bug in the libs. Update to 1.56 and see if it happens again.
Goran, he's using 1.56

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: Operator mod-equal does not compile anymore?

Johannes Lorenz
In reply to this post by Johannes Lorenz
> Have you included `boost/spirit/include/phoenix_operator.hpp`?

Yes, both in my equation solver and the minimal example (the sum example I talked of).

> If so, try defining
>
>      #define BOOST_SPIRIT_USE_PHOENIX_V3

I tried, but it did not help in neither.

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: Operator mod-equal does not compile anymore?

Johannes Lorenz
In reply to this post by Johannes Lorenz
Ok, now I am pretty sure:

  qi/nonterminal/rule.hpp

defines multiple %=-operators:

  friend rule& operator%=(rule& r, Expr const& expr)
  // ...

I guess that the compiler gets confused with them. Has someone an idea how I can still make my %=-operator visible?


Am Donnerstag, 2. Oktober 2014, 10:09:09 schrieb Johannes Lorenz:

> Hello,
>
> I have code that builds up a tree like in the old calc2 examples. The code
> worked good with boost 1.54 + clang 3.4, but I get one error with 1.56/3.6:
>
>     error: no viable overloaded '%=' (no more explanations than that)
>     code: ('%' >> factor          [_val %= _1])
>
> However, it works perfectly for += etc. My full code is here [1]. If you
> prefer a minimal example, use the sum.cpp example [2] and replace += by %=,
> you'll get tons of (different) errors.
>
> Any idea how to fix this?
>
> Many thanks on advance.
> - Johannes

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: Operator mod-equal does not compile anymore?

teajay-2
In reply to this post by Johannes Lorenz
PHOENIX V2 got retiered in boost 1.56. So you don't have any
alternative, it's phoenix V3 point. This will explain why it doesn't
change anything to define BOOST_SPIRIT_USE_PHEONIX_V3.

This is a phoenix bug. There is I think a missing operation reference
in the pheonix operator header.

To test this, add these lines in the header where you need the %=
operator:

namespace boost { namespace phoenix {
using proto::exprns_::operator%=;
}}

If you confirm this fixes your issue, I can file a pull request to fix
this.

Regards,

Thomas Bernard

On 10/02/2014 05:18 PM, Johannes Lorenz wrote:

>> Have you included `boost/spirit/include/phoenix_operator.hpp`?
>
> Yes, both in my equation solver and the minimal example (the sum
> example I talked of).
>
>> If so, try defining
>>
>> #define BOOST_SPIRIT_USE_PHOENIX_V3
>
> I tried, but it did not help in neither.
>
> ------------------------------------------------------------------------------
>
>
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
> Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS
> Reports Are you Audit-Ready for PCI DSS 3.0 Compliance? Download
> White paper Comply to PCI DSS 3.0 Requirement 10 and 11.5 with
> EventLog Analyzer
> http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
>
>
_______________________________________________
> Spirit-general mailing list [hidden email]
> https://lists.sourceforge.net/lists/listinfo/spirit-general
>

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: Operator mod-equal does not compile anymore?

Johannes Lorenz
In reply to this post by Johannes Lorenz
It worked :) I just inserted those 5 lines:

#include <boost/proto/operators.hpp>

namespace boost { namespace phoenix {
        using proto::exprns_::operator%=;
}}

Many thanks for your help and your pull request.


Am Freitag, 3. Oktober 2014, 08:29:38 schrieb Thomas Bernard:

> PHOENIX V2 got retiered in boost 1.56. So you don't have any
> alternative, it's phoenix V3 point. This will explain why it doesn't
> change anything to define BOOST_SPIRIT_USE_PHEONIX_V3.
>
> This is a phoenix bug. There is I think a missing operation reference
> in the pheonix operator header.
>
> To test this, add these lines in the header where you need the %=
> operator:
>
> namespace boost { namespace phoenix {
> using proto::exprns_::operator%=;
> }}
>
> If you confirm this fixes your issue, I can file a pull request to fix
> this.
>
> Regards,
>
> Thomas Bernard

------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general
Reply | Threaded
Open this post in threaded view
|

Re: Operator mod-equal does not compile anymore?

Joel de Guzman
In reply to this post by teajay-2
On 10/3/14, 4:29 PM, Thomas Bernard wrote:

> PHOENIX V2 got retiered in boost 1.56. So you don't have any
> alternative, it's phoenix V3 point. This will explain why it doesn't
> change anything to define BOOST_SPIRIT_USE_PHEONIX_V3.
>
> This is a phoenix bug. There is I think a missing operation reference
> in the pheonix operator header.
>
> To test this, add these lines in the header where you need the %=
> operator:
>
> namespace boost { namespace phoenix {
> using proto::exprns_::operator%=;
> }}
>
> If you confirm this fixes your issue, I can file a pull request to fix
> this.

Thomas, thank you for taking the time to look into this. I applied your
PR.

Regards,
--
Joel de Guzman
http://www.ciere.com
http://boost-spirit.com
http://www.cycfi.com/


------------------------------------------------------------------------------
Meet PCI DSS 3.0 Compliance Requirements with EventLog Analyzer
Achieve PCI DSS 3.0 Compliant Status with Out-of-the-box PCI DSS Reports
Are you Audit-Ready for PCI DSS 3.0 Compliance? Download White paper
Comply to PCI DSS 3.0 Requirement 10 and 11.5 with EventLog Analyzer
http://pubads.g.doubleclick.net/gampad/clk?id=154622311&iu=/4140/ostg.clktrk
_______________________________________________
Spirit-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/spirit-general