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 <thiago.macieira@intel.com>
bb10
Bernhard Rosenkränzer 2015-07-15 15:52:53 +02:00 committed by Thiago Macieira
parent 2806d1c00a
commit cf63c63d55
1 changed files with 4 additions and 4 deletions

View File

@ -238,11 +238,11 @@ void Grammar::buildExtendedGrammar ()
non_terminals.insert (accept_symbol);
}
struct _Nullable: public std::unary_function<Name, bool>
struct Nullable: public std::unary_function<Name, bool>
{
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;