Commit 67ce71ce authored by Paul Hervot's avatar Paul Hervot Committed by Clément Démoulins

rat: printer: fix build issue with Boost >= 1.69

Boost 1.69 introduced an ADL barrier on boost::distance(), so the call
that depended on it failed to build. Simply use qualified name lookup
instead.

See also https://github.com/boostorg/range/pull/75.

* vcsn/core/rat/printer.hh: Fix.
Reported-by: default avatarBaptiste Esteban <baptiste.esteban@epita.fr>

Fix #214
parent c71e8f7d
......@@ -84,6 +84,16 @@ sub fuse($$)
$in_switch = 1;
}
}
elsif (/#define YYCASE_/)
{
# If we're in a switch but see this macro, keep the switch as is
# altogether
# Usually at this point $pre_case contains the openning '{' of the
# switch
$_ = $pre_case . $_;
$pre_case = '';
$in_switch = 0;
}
else
{
# in switch.
......
......@@ -7,6 +7,12 @@ import sys
import vcsn
try:
repatterntype = re.Pattern
except AttributeError:
# Before Python 3.7
repatterntype = re._pattern_type
ntest = 0
npass = 0
nfail = 0
......@@ -169,7 +175,7 @@ def XFAIL(fun, exp=None):
# while reading automaton: efsm.dir/bad_final_weight.efsm
eff = str(e).replace(medir + '/', '')
if (exp is None
or isinstance(exp, re._pattern_type) and re.match(exp, eff)
or isinstance(exp, repatterntype) and re.match(exp, eff)
or isinstance(exp, str) and exp in eff):
PASS()
else:
......
......@@ -289,7 +289,7 @@ namespace vcsn
// If in front of a row of letters, in strictly increasing
// order, issue a class.
auto r = letter_range(i, end);
if (3 < distance(r))
if (3 < boost::distance(r))
{
// Gather the letters.
auto letters = std::vector<label_t>{};
......
......@@ -285,6 +285,16 @@ namespace vcsn
/// Worklist of state tuples.
std::deque<std::pair<state_name_t, state_t>> todo_;
};
// C++14: declare `indices` at namespace-scope. It is a static constexpr and
// C++14 needs that declaration to make it odr-usable (otherwise, some
// compilers give an undefined reference to it when we it's odr-used)
// This can be removed when compiling in C++17 because this standard
// introduces the concept of inline constexpr and makes all constexpr inline
// by default.
template <Automaton Aut, Automaton... Auts>
constexpr typename tuple_automaton_impl<Aut, Auts...>::indices_t
tuple_automaton_impl<Aut, Auts...>::indices;
}
/// A tuple automaton as a shared pointer.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment