diff options
author | H.J. Lu <hongjiu.lu@intel.com> | 2009-03-08 17:29:12 +0000 |
---|---|---|
committer | H.J. Lu <hjl@gcc.gnu.org> | 2009-03-08 10:29:12 -0700 |
commit | ae9b2a481c0f6510271cf12f86cd3b6b86490a96 (patch) | |
tree | 5629a4fada17111aca9ed99113dd06ed98c105e2 /gcc/cp/parser.c | |
parent | 975a4fd69f8d84b2414445745195d0b6ced3a39c (diff) | |
download | gcc-ae9b2a481c0f6510271cf12f86cd3b6b86490a96.zip gcc-ae9b2a481c0f6510271cf12f86cd3b6b86490a96.tar.gz gcc-ae9b2a481c0f6510271cf12f86cd3b6b86490a96.tar.bz2 |
re PR c++/39060 (ICE with lots of invalid member functions)
gcc/cp/
2009-03-08 H.J. Lu <hongjiu.lu@intel.com>
PR c++/39060
* parser.c (cp_parser_late_parsing_default_args): Continue
the loop when cp_parser_assignment_expression returns
error_mark_node.
gcc/testsuite/
2009-03-08 H.J. Lu <hongjiu.lu@intel.com>
PR c++/39060
* g++.dg/other/new1.C: Adjusted.
* g++.dg/parse/crash40.C: Likewise.
* g++.dg/parse/defarg12.C: Likewise.
* g++.dg/template/error15.C: Likewise.
* g++.dg/other/pr39060.C: New.
From-SVN: r144710
Diffstat (limited to 'gcc/cp/parser.c')
-rw-r--r-- | gcc/cp/parser.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/cp/parser.c b/gcc/cp/parser.c index 5c5c912..4c6fd4a 100644 --- a/gcc/cp/parser.c +++ b/gcc/cp/parser.c @@ -18291,6 +18291,11 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn) /* Parse the assignment-expression. */ parsed_arg = cp_parser_assignment_expression (parser, /*cast_p=*/false, NULL); + if (parsed_arg == error_mark_node) + { + cp_parser_pop_lexer (parser); + continue; + } if (!processing_template_decl) parsed_arg = check_default_argument (TREE_VALUE (parm), parsed_arg); |