mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-02-14 20:00:22 +08:00
re PR c++/13269 (compiler hangs on invalid code)
PR c++/13269 * parser.c (cp_parser_function_definition_after_declarator): Stop scanning tokens when reaching EOF. PR c++/13269 * g++.dg/parse/error5.C: New test. From-SVN: r74661
This commit is contained in:
parent
ea0e2a51f4
commit
21eb631b82
@ -1,5 +1,9 @@
|
||||
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.
|
||||
|
||||
|
@ -13807,7 +13807,8 @@ cp_parser_function_definition_after_declarator (cp_parser* parser,
|
||||
/* 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
|
||||
|
@ -1,5 +1,8 @@
|
||||
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.
|
||||
|
||||
|
4
gcc/testsuite/g++.dg/parse/error5.C
Normal file
4
gcc/testsuite/g++.dg/parse/error5.C
Normal file
@ -0,0 +1,4 @@
|
||||
// PR c++/13269
|
||||
|
||||
class Foo { int foo() return 0; } }; // { dg-error "" }
|
||||
|
Loading…
Reference in New Issue
Block a user