summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-08-05 09:28:48 +0200
committerLiang Qi <liang.qi@qt.io>2019-08-05 09:28:48 +0200
commitf3b28e80211881ab78879eb5acbf5de5d1b1e38c (patch)
treecf283c7a44bdfc4113d48ec12daa0c3d711aae99 /src/tools
parent4d7271087e84096abd75fa806bea234daee0cd94 (diff)
parent8c0787cfa1a906ebe25907515d86050303b127e7 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts: qmake/generators/unix/unixmake2.cpp src/plugins/platforms/cocoa/qcocoawindow.mm Change-Id: Iba7aa7324f35543e0297a3680956420058cd3630
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/qlalr/lalr.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/tools/qlalr/lalr.cpp b/src/tools/qlalr/lalr.cpp
index ec960925aa..541523d49c 100644
--- a/src/tools/qlalr/lalr.cpp
+++ b/src/tools/qlalr/lalr.cpp
@@ -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;