qlalr: fix compilation with C++20
std::not1 is deprecated in C++17, removed in C++20. Use its replacement, std::not_fn. Change-Id: I37d4929c81c2a5befeb44f954ae77b23960d2ff0 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>bb10
parent
174061f9f3
commit
9ad8debe38
|
|
@ -295,6 +295,12 @@ void Automaton::build ()
|
|||
buildDefaultReduceActions ();
|
||||
}
|
||||
|
||||
#if defined(__cpp_lib_not_fn) && __cpp_lib_not_fn >= 201603
|
||||
# define Q_NOT_FN std::not_fn
|
||||
#else
|
||||
# define Q_NOT_FN std::not1
|
||||
#endif
|
||||
|
||||
void Automaton::buildNullables ()
|
||||
{
|
||||
bool changed = true;
|
||||
|
|
@ -305,7 +311,7 @@ void Automaton::buildNullables ()
|
|||
|
||||
for (RulePointer rule = _M_grammar->rules.begin (); rule != _M_grammar->rules.end (); ++rule)
|
||||
{
|
||||
NameList::iterator nn = std::find_if (rule->rhs.begin (), rule->rhs.end (), std::not1 (Nullable (this)));
|
||||
NameList::iterator nn = std::find_if(rule->rhs.begin(), rule->rhs.end(), Q_NOT_FN(Nullable(this)));
|
||||
|
||||
if (nn == rule->rhs.end ())
|
||||
changed |= nullables.insert (rule->lhs).second;
|
||||
|
|
@ -646,7 +652,7 @@ void Automaton::buildIncludesDigraph ()
|
|||
if (! _M_grammar->isNonTerminal (*A))
|
||||
continue;
|
||||
|
||||
NameList::iterator first_not_nullable = std::find_if (dot, rule->rhs.end (), std::not1 (Nullable (this)));
|
||||
NameList::iterator first_not_nullable = std::find_if(dot, rule->rhs.end(), Q_NOT_FN(Nullable(this)));
|
||||
if (first_not_nullable != rule->rhs.end ())
|
||||
continue;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue