The following program: -------------------------------- int foo(int dest) { int x = 0; __label__ l1, l2, l3; __label__ *lb[] = { &&l1, &&l2, &&l3 }; goto **lb[dest]; l1: x += 1; l2: x += 1; l3: x += 1; return x; } -------------------------------- produce an infinite loop in diagnostic when compiled with G++ 3.4.3: label.cc:5: error: expected identifier before '*' token label.cc:5: error: expected `,' before '*' token label.cc:5: error: expected identifier before '*' token label.cc:5: error: expected `,' before '*' token label.cc:5: error: expected identifier before '*' token label.cc:5: error: expected `,' before '*' token label.cc:5: error: expected identifier before '*' token label.cc:5: error: expected `,' before '*' token label.cc:5: error: expected identifier before '*' token label.cc:5: error: expected `,' before '*' token label.cc:5: error: expected identifier before '*' token label.cc:5: error: expected `,' before '*' token label.cc:5: error: expected identifier before '*' token [....]
With checking enabled we get an ICE: t.cc: In function `int foo(int)': t.cc:5: error: expected identifier before '*' token t.cc:5: internal compiler error: tree check: expected identifier_node, have error_mark in declare_local_label, at cp/decl.c:2162 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions. And this is a regression from 3.3.3.
: Search converges between 2002-12-14-trunk (#159) and 2002-12-29-trunk (#160). This started with the new parser.
Testing a patch.
Subject: Bug 20563 CVSROOT: /cvs/gcc Module name: gcc Changes by: reichelt@gcc.gnu.org 2005-06-08 11:09:13 Modified files: gcc/cp : ChangeLog parser.c pt.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/ext: label4.C gcc/testsuite/g++.dg/template: ptrmem15.C Log message: PR c++/19894 * pt.c (tsubst): Reject pointer-to-member of type void. * g++.dg/template/ptrmem15.C: New test. PR c++/20563 * parser.c (cp_parser_label_declaration): Deal with invalid/missing identifiers. * g++.dg/ext/label4.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4781&r2=1.4782 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&r1=1.339&r2=1.340 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.1003&r2=1.1004 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.5612&r2=1.5613 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/label4.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/ptrmem15.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
Subject: Bug 20563 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: reichelt@gcc.gnu.org 2005-06-08 11:26:06 Modified files: gcc/cp : ChangeLog parser.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/ext: label4.C Log message: PR c++/20563 * parser.c (cp_parser_label_declaration): Deal with invalid/missing identifiers. * g++.dg/ext/label4.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.222&r2=1.3892.2.223 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.157.2.55&r2=1.157.2.56 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.401&r2=1.3389.2.402 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/label4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
Fixed on mainline (will become GCC 4.1.0) and the 3.4-branch (will become GCC 3.4.5). Waiting for the 4.0 branch to thaw.
Subject: Bug 20563 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-4_0-branch Changes by: reichelt@gcc.gnu.org 2005-07-11 12:57:06 Modified files: gcc/cp : ChangeLog parser.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/ext: label4.C Log message: PR c++/20563 * parser.c (cp_parser_label_declaration): Deal with invalid/missing identifiers. * g++.dg/ext/label4.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4648.2.61&r2=1.4648.2.62 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/parser.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.319.2.9&r2=1.319.2.10 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.263&r2=1.5084.2.264 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/label4.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.10.1
Now also fixed on the 4.0 branch.