If the constructor of a class does not match the class name, the compiler dies with a segfault. I'll attach an example program. running > g++ test.cc test.cc:6: internal compiler error: Segmentation fault will already trigger the bug. The source code is not valid code, but with previous versions (e.g. 4.2) I got a meaningful error message: > g++-4.2 test.cc test.cc:6: error: expected class-name before ‘(’ token Cheers Christian
Created attachment 17319 [details] example to trigger the bug
It works for me with the release-checking built 4.3.3 release (as well as 4.3.0, 4.3.1 and 4.3.2). With the branch r143959 and checking enabled it gives test.cc:6: internal compiler error: tree check: expected class ‘type’, have ‘exceptional’ (identifier_node) in constructor_name_full, at cp/name-lookup.c:1715 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions. so I'm not sure if this is a regression.
Created attachment 17324 [details] preprocessed test.cc
It works for me with: GNU C++ (GCC) version 4.4.0 20081229 (experimental) [trunk revision 142951] (i386-apple-darwin8.11.1) compiled by GNU C version 4.4.0 20081229 (experimental) [trunk revision 142951], GMP version 4.2.2, MPFR version 2.3.0.
And: GNU C++ (GCC) version 4.4.0 20090116 (experimental) [trunk revision 143448] (powerpc64-unknown-linux-gnu) compiled by GNU C version 4.4.0 20090116 (experimental) [trunk revision 143448], GMP version 4.2.2, MPFR version 2.3.1.
And in the release of 4.3.2 with checking turned on.
It is caused by revision 143502 on trunk: http://gcc.gnu.org/ml/gcc-cvs/2009-01/msg00515.html
Subject: Bug 39225 Author: jason Date: Fri Feb 20 05:32:40 2009 New Revision: 144314 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144314 Log: PR c++/39225 * decl.c (grokdeclarator): Handle ~identifier. Added: trunk/gcc/testsuite/g++.dg/parse/dtor15.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/decl.c trunk/gcc/testsuite/ChangeLog
Fixed.
I think 4.3 branch is still broken.
Subject: Bug 39225 Author: jason Date: Fri Feb 20 15:21:51 2009 New Revision: 144325 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=144325 Log: PR c++/39225 * decl.c (grokdeclarator): Handle ~identifier. Added: branches/gcc-4_3-branch/gcc/testsuite/g++.dg/parse/dtor15.C - copied unchanged from r144314, trunk/gcc/testsuite/g++.dg/parse/dtor15.C Modified: branches/gcc-4_3-branch/gcc/cp/ChangeLog branches/gcc-4_3-branch/gcc/cp/decl.c branches/gcc-4_3-branch/gcc/testsuite/ChangeLog
Fixed in 4.3 as well.
*** Bug 40284 has been marked as a duplicate of this bug. ***