diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2020-05-04 17:01:38 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2020-05-05 12:28:23 -0700 |
commit | 0ef6b3d138d5d3e7199d65cb7c6b0042f9437884 (patch) | |
tree | fbd37ed7a83ecdc6eef4363c73826587431d12c7 /src/tools | |
parent | ee3ab7829d0e56feb307e1dff7935d231dfade3a (diff) |
Remove use of std::not1 completely
libc++ that comes with XCode does not have the feature macros, resulting in
warnings printed. Just invert the condition in the functor itself.
lalr.cpp:316:84: warning: 'not1<Nullable>' is deprecated [-Wdeprecated-declarations]
Pick-To: 5.15
Change-Id: I99ab0f318b1c43b89888fffd160bf8d79bc4b47e
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Diffstat (limited to 'src/tools')
-rw-r--r-- | src/tools/qlalr/lalr.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/tools/qlalr/lalr.cpp b/src/tools/qlalr/lalr.cpp index c7269bed5f..c3d3da41fa 100644 --- a/src/tools/qlalr/lalr.cpp +++ b/src/tools/qlalr/lalr.cpp @@ -244,16 +244,16 @@ void Grammar::buildExtendedGrammar () non_terminals.insert (accept_symbol); } -struct Nullable +struct NotNullable { typedef Name argument_type; Automaton *_M_automaton; - Nullable (Automaton *aut): + NotNullable (Automaton *aut): _M_automaton (aut) {} bool operator () (Name name) const - { return _M_automaton->nullables.find (name) != _M_automaton->nullables.end (); } + { return _M_automaton->nullables.find (name) == _M_automaton->nullables.end (); } }; Automaton::Automaton (Grammar *g): @@ -297,12 +297,6 @@ 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; @@ -313,7 +307,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(), Q_NOT_FN(Nullable(this))); + NameList::iterator nn = std::find_if(rule->rhs.begin(), rule->rhs.end(), NotNullable(this)); if (nn == rule->rhs.end ()) changed |= nullables.insert (rule->lhs).second; @@ -654,7 +648,7 @@ void Automaton::buildIncludesDigraph () if (! _M_grammar->isNonTerminal (*A)) continue; - NameList::iterator first_not_nullable = std::find_if(dot, rule->rhs.end(), Q_NOT_FN(Nullable(this))); + NameList::iterator first_not_nullable = std::find_if(dot, rule->rhs.end(), NotNullable(this)); if (first_not_nullable != rule->rhs.end ()) continue; |