Commit a5682d15 by Ian Lance Taylor

Better handling of unexpected EOF in parser.

From-SVN: r179060
parent 70f3cf69
......@@ -1299,6 +1299,13 @@ Parse::declaration_may_start_here()
void
Parse::decl(void (Parse::*pfn)(void*), void* varg)
{
if (this->peek_token()->is_eof())
{
if (!saw_errors())
error_at(this->location(), "unexpected end of file");
return;
}
if (!this->peek_token()->is_op(OPERATOR_LPAREN))
(this->*pfn)(varg);
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment