Commit Graph

3 Commits

Author SHA1 Message Date
Nikita Kniazev
877c778ed9 X3.Tests: rule_separate_tu: Fix static initialization order fiasco 2019-11-03 21:01:58 +03:00
Nikita Kniazev
afe763b61e X3: Fixed static assert on parse_rule instantiation
During overload resolution disallowed signature can be instantiated leading
to firing the static assertation and overload resolution failure. I could
just remove it, but do not want to leave unbounded by value overloads;
replacing to not deducing Attribute with specifying a default parameter will
not work because we want to allow `BOOST_SPIRIT_DECLARE` without prior
`BOOST_SPIRIT_DEFINE` - this requires having default parameters in both
declaration and definition and the standard seems to forbid it (GCC - fine,
MSVC - warning, Clang - error).

Reverts #437, fixes #453.
2019-02-08 14:51:35 +03:00
Nikita Kniazev
a3cf3f2c3e X3: Fixed wrong parse_rule signature instantiation
When a rule has no attribute (leaves `Attribute` template parameter as default)
the `BOOST_SPIRIT_INSTANTIATE` macro instantiates a `parse_rule` helper function
with a wrong signature because `parse`, `phrase_parse`, and `skip_over` pass as
the attribute `unused` variable which deduces to `unused_type const&` type, but
`BOOST_SPIRIT_INSTANTIATE` instantiates `parse_rule` with `unused_type&` type.
2019-01-26 17:32:04 +03:00