* parser.c (cp_parser_function_definition_after_declarator): Stop
scanning tokens when reaching EOF.
PR c++/13269
* g++.dg/parse/error5.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@74661
138bc75d-0d04-0410-961f-
82ee72b054a4
2003-12-15 Mark Mitchell <mark@codesourcery.com>
+ PR c++/13269
+ * parser.c (cp_parser_function_definition_after_declarator): Stop
+ scanning tokens when reaching EOF.
+
PR c++/12989
* typeck.c (cxx_sizeof_or_alignof_expr): Robustify.
/* Issue an error message. */
error ("named return values are no longer supported");
/* Skip tokens until we reach the start of the function body. */
- while (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE))
+ while (cp_lexer_next_token_is_not (parser->lexer, CPP_OPEN_BRACE)
+ && cp_lexer_next_token_is_not (parser->lexer, CPP_EOF))
cp_lexer_consume_token (parser->lexer);
}
/* The `extern' in `extern "C" void f () { ... }' does not apply to
2003-12-15 Mark Mitchell <mark@codesourcery.com>
+ PR c++/13269
+ * g++.dg/parse/error5.C: New test.
+
PR c++/12989
* g++.dg/expr/sizeof1.C: New test.
--- /dev/null
+// PR c++/13269
+
+class Foo { int foo() return 0; } }; // { dg-error "" }
+