This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/29571] New: [4.2/4.3 regression] ICE with invalid static const member
- 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: 23 Oct 2006 20:09:43 -0000
- Subject: [Bug c++/29571] New: [4.2/4.3 regression] ICE with invalid static const member
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following invalid code snippet triggers an ICE on mainline and 4.3 branch:
======================================
struct A
{
static const int i = 0/0 + "";
static const int j = int(i);
};
======================================
bug.cc:3: warning: division by zero in '0 / 0'
bug.cc:3: error: invalid conversion from 'const char*' to 'int'
bug.cc:3: error: 'A::i' cannot be initialized by a non-constant expression when
being declared
bug.cc:4: internal compiler error: in build_c_cast, at cp/typeck.c:5491
Please submit a full bug report, [etc.]
--
Summary: [4.2/4.3 regression] ICE with invalid static const
member
Product: gcc
Version: 4.3.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code, error-recovery, 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=29571