From cf63c63d558227fdbef09699c261560e7474f5ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernhard=20Rosenkr=C3=A4nzer?= Date: Wed, 15 Jul 2015 15:52:53 +0200 Subject: [PATCH] Fix build with clang 3.7 _Nullable is a language extension in clang 3.7 (indicating whether or not a pointer can be null). http://clang.llvm.org/docs/AttributeReference.html#nullable Using it as a class name breaks building with this compiler. Change-Id: I0c838dac872ca2c00bf57c95df17d24edb48007b Reviewed-by: Thiago Macieira --- src/tools/qlalr/lalr.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git src/tools/qlalr/lalr.cpp src/tools/qlalr/lalr.cpp index 3d0d5de19b..3d780cd618 100644 --- src/tools/qlalr/lalr.cpp +++ src/tools/qlalr/lalr.cpp @@ -238,11 +238,11 @@ void Grammar::buildExtendedGrammar () non_terminals.insert (accept_symbol); } -struct _Nullable: public std::unary_function +struct Nullable: public std::unary_function { Automaton *_M_automaton; - _Nullable (Automaton *aut): + Nullable (Automaton *aut): _M_automaton (aut) {} bool operator () (Name name) const @@ -300,7 +300,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 (), std::not1 (Nullable (this))); if (nn == rule->rhs.end ()) changed |= nullables.insert (rule->lhs).second; @@ -635,7 +635,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 (), std::not1 (Nullable (this))); if (first_not_nullable != rule->rhs.end ()) continue;