ICE for the definition of a static const member that was initialized inside the class with an unknown identifier. Release: 3.4 20030203 (experimental) Environment: System: Linux dwarf 2.4.3-XFS #7 Mon Aug 6 18:43:20 CEST 2001 i686 unknown Architecture: i686 host: i686-pc-linux-gnu build: i686-pc-linux-gnu target: i686-pc-linux-gnu configured with: /pdsrc/gcc/cvs/gcc/configure --program-suffix=-test --prefix=/local/gcc-test --enable-shared --enable-threads=posix --enable-version-specific-runtime-libs --enable-languages=c,c++ How-To-Repeat: See attached code. test code: namespace N { enum E { max = 5 }; } // N class A { public: static const N::E size = max; int table[size]; }; const N::E A::size; int main() { A a; return 0; }
State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed. A shorter testcase is ----------------- struct A { static const int size = BOGUS; }; const int A::size; ---------------------- tmp/g> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc x.cc:2: error: `BOGUS' was not declared in this scope x.cc:4: internal compiler error: Segmentation fault It's a mainline regression, 3.3 just gives a reasonable error. W.
From: "Giovanni Bajo" <giovannibajo@libero.it> To: <gcc-gnats@gcc.gnu.org>, <gcc-bugs@gcc.gnu.org>, <nobody@gcc.gnu.org>, <dv@vollmann.ch>, <gcc-prs@gcc.gnu.org> Cc: Subject: Re: c++/9559: [3.4 regression] ICE with invalid initialization of a static const member Date: Thu, 1 May 2003 21:03:53 +0200 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=9559 With 3.3 CVS 20030421 and 3.4 CVS 20030430 I get an ICE on the minimal snippet. I will update the synopsis to reflect the regression on the 3.3 branch as well (3.2 does not ICE). Giovanni Bajo
Moving target back to 3.3.1.
Subject: Bug 9559 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2003-07-01 07:17:03 Modified files: gcc/cp : ChangeLog decl2.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/init: static1.C Log message: PR c++/9559 * decl2.c (grokfield): Do not build NOP_EXPRs around the error_mark_node. PR c++/9559 * g++.dg/init/static1.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3473&r2=1.3474 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&r1=1.632&r2=1.633 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2821&r2=1.2822 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/static1.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
Subject: Bug 9559 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: mmitchel@gcc.gnu.org 2003-07-01 07:18:26 Modified files: gcc/cp : ChangeLog decl2.c gcc/testsuite : ChangeLog Log message: PR c++/9559 * decl2.c (grokfield): Do not build NOP_EXPRs around the error_mark_node. PR c++/9559 * g++.dg/init/static1.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.169&r2=1.3076.2.170 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl2.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.575.2.30&r2=1.575.2.31 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.209&r2=1.2261.2.210
Fixed in GCC 3.3.1, GCC 3.4.
Subject: Bug 9559 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: mmitchel@gcc.gnu.org 2003-07-02 01:53:45 Added files: gcc/testsuite/g++.dg/init: static1.C Log message: PR c++/9559 * g++.dg/init/static1.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/init/static1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1