This is GCC Bugzilla
This is GCC Bugzilla Version 2.20+
View Bug Activity | Format For Printing | Clone This Bug
g++ crashes when trying to compile the (pre-processed) source code appended below. Release: 3.1 Environment: System: Linux peti.int.muc.intenga.com 2.4.19-gentoo-r7 #15 Wed Aug 7 23:51:37 CEST 2002 i686 AuthenticAMD Architecture: i686 host: i586-pc-linux-gnu build: i586-pc-linux-gnu target: i586-pc-linux-gnu configured with: /var/tmp/portage/gcc-3.1-r6/work/gcc-3.1/configure --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --enable-shared --host=i586-pc-linux-gnu --build=i586-pc-linux-gnu --target=i586-pc-linux-gnu --enable-threads=posix --enable-long-long --enable-cstdio=stdio --enable-clocale=generic --disable-checking --with-gxx-include-dir=/usr/include/g++-v31 --with-local-prefix=/usr/local --with-system-zlib --enable-shared --enable-nls --without-included-gettext
Fix: Fixed in GCC 3.3, GCC 3.4 with: http://gcc.gnu.org/ml/gcc-patches/2003-03/msg02495.html
From: Reichelt <reichelt@igpm.rwth-aachen.de> To: simons@cryp.to, gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org, nobody@gcc.gnu.org Cc: Subject: Re: c++/7647: Internal compiler error Date: Mon, 30 Sep 2002 12:14:59 +0200 Hi, the problem can be reduced to the following code snippet: -------------------------snip here--------------------- template <typename T> struct A { void foo () const {} char A; }; void bar() { A<void>().foo(); } -------------------------snip here--------------------- The code crashes with gcc 3.0.x, 3.1, 3.2, and the main trunk (as of 20020923). Checked on mips-sgi-irix6.5 and i686-pc-linux-gnu. The error is: PR7647.cc: In instantiation of `void A<T>::foo() const [with T = void]': PR7647.cc:7: instantiated from here PR7647.cc:3: internal compiler error: Segmentation fault Please submit a full bug report, [etc.] With gcc 2.95.3 I get: PR7647.cc:4: ANSI C++ forbids data member `A' with same name as enclosing class PR7647.cc: In instantiation of `A<void>::foo() const': PR7647.cc:7: instantiated from here PR7647.cc:3: confused by earlier errors, bailing out Greetings, Volker Reichelt http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=7647
State-Changed-From-To: open->analyzed State-Changed-Why: Confirmed.
Responsible-Changed-From-To: unassigned->mmitchel Responsible-Changed-Why: Working on a fix.
From: mmitchel@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: c++/7647 Date: 30 Mar 2003 22:30:54 -0000 CVSROOT: /cvs/gcc Module name: gcc Changes by: mmitchel@gcc.gnu.org 2003-03-30 22:30:54 Modified files: gcc/cp : ChangeLog decl.c search.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/lookup: class-member-2.C Log message: PR c++/7647 * decl.c (grokdeclarator): Tidy, slightly. * search.c (lookup_field_1): Add want_type parameter. (lookup_field_r): Adjust call to lookup_field_1. PR c++/7647 * g++.dg/lookup-class-member-2.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3306&r2=1.3307 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/decl.c.diff?cvsroot=gcc&r1=1.1029&r2=1.1030 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/search.c.diff?cvsroot=gcc&r1=1.257&r2=1.258 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2556&r2=1.2557 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/class-member-2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
From: mmitchel@gcc.gnu.org To: gcc-gnats@gcc.gnu.org Cc: Subject: c++/7647 Date: 30 Mar 2003 22:34:05 -0000 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: mmitchel@gcc.gnu.org 2003-03-30 22:34:05 Modified files: gcc/cp : ChangeLog search.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/lookup: class-member-2.C Log message: PR c++/7647 * decl.c (grokdeclarator): Tidy, slightly. * search.c (lookup_field_1): Add want_type parameter. (lookup_field_r): Adjust call to lookup_field_1. PR c++/7647 * g++.dg/lookup-class-member-2.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.99&r2=1.3076.2.100 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/search.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.243.2.3&r2=1.243.2.4 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.129&r2=1.2261.2.130 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/lookup/class-member-2.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1
State-Changed-From-To: analyzed->closed State-Changed-Why: Fixed for 3.3.