-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
boost variant order of parameters relevant in 1.78.0 ? #721
Comments
Pulling the repro from #722 here: #include <boost/spirit/home/x3.hpp>
#include <boost/variant/variant.hpp>
#include <boost/fusion/include/std_pair.hpp>
int main()
{
namespace x3 = boost::spirit::x3;
using namespace x3;
char const* s = "";
struct A {};
struct B {};
struct C {};
boost::variant<
std::pair<int, boost::variant<B, A>>,
C
> target;
x3::parse(s, s,
attr(int{}) >> (attr(A{}) | attr(B{}))
| attr(C{})
, target);
} |
Fix boostorg#721, boostorg#722. Experimental: use optional<variant>
Does this also solve #707 ? |
Apparently it doesn't solve #707 because when I tried compiling the issue707.cpp test case, I got errors. The start of the error messages were:
|
Some of our code broke after the 1.78.0 update. I finally managed to pinpoint the issue. It looks like for some reason a grammar that is a disjunction needs the same order of parameters in the variant to be synthesized. Was this something that should not have compiled in 1.77 or is it something that broke in 78?
The following code works in 77 but not in 78:
https://godbolt.org/z/MKMezMTqq
After switching the order of the parameters in the X variant from B,A to A,B it works in both versions:
https://godbolt.org/z/6e6sMKTYW
The text was updated successfully, but these errors were encountered: