diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2009-02-02 00:41:52 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2009-02-02 00:41:52 +0000 |
commit | def88a88c4a6096e2204ca9b2776f1ef00b762b8 (patch) | |
tree | d570be31ea5606581fa0af5ca3f8f054a51407cf /gcc/cp | |
parent | 27c40174aee71acf3a80a3b65d2222ad664981bb (diff) | |
download | gcc-def88a88c4a6096e2204ca9b2776f1ef00b762b8.zip gcc-def88a88c4a6096e2204ca9b2776f1ef00b762b8.tar.gz gcc-def88a88c4a6096e2204ca9b2776f1ef00b762b8.tar.bz2 |
re PR c++/39053 (ICE with broken function declaration)
/cp
2009-02-01 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/39053
* parser.c (cp_parser_pure_specifier): If there are no tokens left
do not call cp_lexer_consume_token.
/testsuite
2009-02-01 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/39053
* g++.dg/parse/crash52.C: New.
From-SVN: r143861
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/parser.c | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index f48474c..eeec03d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2009-02-01 Paolo Carlini <paolo.carlini@oracle.com> + + PR c++/39053 + * parser.c (cp_parser_pure_specifier): If there are no tokens left + do not call cp_lexer_consume_token. + 2009-01-30 Jakub Jelinek <jakub@redhat.com> PR c++/39028 diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 5be2318..5675e9b 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -15997,7 +15997,13 @@ cp_parser_pure_specifier (cp_parser* parser) if (!cp_parser_require (parser, CPP_EQ, "%<=%>")) return error_mark_node; /* Look for the `0' token. */ - token = cp_lexer_consume_token (parser->lexer); + token = cp_lexer_peek_token (parser->lexer); + + if (token->type == CPP_EOF + || token->type == CPP_PRAGMA_EOL) + return error_mark_node; + + cp_lexer_consume_token (parser->lexer); /* Accept = default or = delete in c++0x mode. */ if (token->keyword == RID_DEFAULT |