diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2014-04-28 12:32:06 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2014-04-28 12:32:06 +0000 |
commit | a3879fa1a8ebe123216f5bc5e57cc30a0265e666 (patch) | |
tree | 4efe90893901cfcd9efa1fb6f57cac10681b5e8b /gcc/cp/parser.c | |
parent | 2cbf2d9595cc705613fde7eb201d207adb92495d (diff) | |
download | gcc-a3879fa1a8ebe123216f5bc5e57cc30a0265e666.zip gcc-a3879fa1a8ebe123216f5bc5e57cc30a0265e666.tar.gz gcc-a3879fa1a8ebe123216f5bc5e57cc30a0265e666.tar.bz2 |
re PR c++/59120 ([c++11] ICE with invalid template alias)
/cp
2014-04-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/59120
* parser.c (cp_parser_alias_declaration): Check return value of
cp_parser_require.
/testsuite
2014-04-28 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/59120
* g++.dg/cpp0x/alias-decl-43.C: New.
From-SVN: r209857
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index c1d94ae..962cace 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -16142,15 +16142,8 @@ cp_parser_alias_declaration (cp_parser* parser) if (parser->num_template_parameter_lists) parser->type_definition_forbidden_message = saved_message; - if (type == error_mark_node) - { - cp_parser_skip_to_end_of_block_or_statement (parser); - return error_mark_node; - } - - cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON); - - if (cp_parser_error_occurred (parser)) + if (type == error_mark_node + || !cp_parser_require (parser, CPP_SEMICOLON, RT_SEMICOLON)) { cp_parser_skip_to_end_of_block_or_statement (parser); return error_mark_node; |