The following invalid code snippet triggers an ICE on mainline: =================== void foo() { namespace N { =================== bug.cc: In function 'void foo()': bug.cc:3: error: 'namespace' definition is not allowed here bug.cc:3: internal compiler error: in cp_lexer_consume_token, at cp/parser.c:638 Please submit a full bug report, [etc.]
Subject: Bug number PR c++/31745 A patch for this bug has been added to the patch tracker. The mailing list url for the patch is http://gcc.gnu.org/ml/gcc-patches/2007-05/msg01091.html
Subject: Bug 31745 Author: simartin Date: Fri May 25 20:26:36 2007 New Revision: 125070 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=125070 Log: 2007-05-25 Simon Martin <simartin@users.sourceforge.net> Manuel Lopez-Ibanez <manu@gcc.gnu.org> PR c++/31745 * parser.c (cp_parser_skip_to_closing_brace): Return true if the next token is a closing brace, false if there are no tokens left. (cp_parser_namespace_alias_definition): Only consume the next token if it is a closing brace. * parser.c (cp_parser_class_specifier): Likewise. Added: trunk/gcc/testsuite/g++.dg/parse/crash34.C trunk/gcc/testsuite/g++.dg/parse/crash35.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/parser.c trunk/gcc/testsuite/ChangeLog
Fixed on the mainline.
Fixed.