Reputation: 972
While trying to make a smaller reproducible case from my code base, I reach the code below.
For me, it fails to compile with g++6.1 and boost 1.60 and boost develop.
The grammars and rules use default types for the skipper and the other bit and only specify the iterator and the signature. Is that the problem?
#include <iostream>
#include <boost/spirit/include/qi.hpp>
#include <boost/spirit/include/support_istream_iterator.hpp>
#include <boost/phoenix.hpp>
namespace qis = boost::spirit::qi;
namespace pnx = boost::phoenix;
using qis::_r1; using qis::_r2;
using qis::_val;
template <typename Iterator>
struct G2 : public qis::grammar<Iterator, int(int)>
{
G2()
: G2::base_type(start_)
{
start_ %= qis::int_
[
pnx::if_( _r1 == 5 )
[
_val = 6
]
.else_
[
_val = 7
]
];
}
qis::rule<Iterator, int(int)> start_;
};
template <typename Iterator>
struct G1 : public qis::grammar<Iterator, int(int)>
{
G1()
: G1::base_type(start_)
{
start_ %= g2_(_r1);
}
G2<Iterator> g2_;
qis::rule<Iterator, int(int)> start_;
};
template <typename Iterator>
struct G : public qis::grammar<Iterator, int()>
{
G()
: G::base_type(start_)
{
int i;
start_ %= g1_(i);
}
G1<Iterator> g1_;
qis::rule<Iterator, int()> start_;
};
int main()
{
G<boost::spirit::istream_iterator> g;
return 0;
}
Upvotes: 0
Views: 53