This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28338] New: [4.0/4.1/4.2 regression] ICE/rejects-valid with references
- From: "reichelt at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Jul 2006 09:39:37 -0000
- Subject: [Bug c++/28338] New: [4.0/4.1/4.2 regression] ICE/rejects-valid with references
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following valid code snippet triggers an ICE since GCC 3.4.0:
=======================================
void foo()
{
{ static const int& i = 0; }
{ static const int& i = 0; }
}
=======================================
bug.cc:4: error: redefinition of 'int _ZGRZ3foovE1i'
bug.cc:3: error: 'int _ZGRZ3foovE1i' previously declared here
bug.cc: In function 'void foo()':
bug.cc:4: internal compiler error: in layout_decl, at stor-layout.c:305
Please submit a full bug report, [etc.]
In addition the error message before the ICE is bogus, since the code
is valid. The error message was introduced in GCC 3.1.
--
Summary: [4.0/4.1/4.2 regression] ICE/rejects-valid with
references
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code, rejects-valid, monitored
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28338