diff --git a/gcc/c-lex.c b/gcc/c-lex.c index 00feafdb25b..d818f33e868 100644 --- a/gcc/c-lex.c +++ b/gcc/c-lex.c @@ -1024,6 +1024,13 @@ yylex () { case EOF: end_of_file = 1; + if (! global_bindings_p ()) + { + yyerror ("parse error"); + token_buffer[0] = '}'; + value = '}'; + break; + } token_buffer[0] = 0; value = ENDFILE; break;