This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15938] New: ICE with anonymous unions
- 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 Jun 2004 12:24:06 -0000
- Subject: [Bug c++/15938] New: ICE with anonymous unions
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code is accepted by the C frontend, but the C++ frontend
segfaults (since gcc 2.95.x).
===================================
typedef union
{
struct { int i; };
struct { char c; };
} A;
A a = { 0 };
===================================
bug.cc:7: error: union `A' with no named members cannot be initialized
bug.cc:7: internal compiler error: Segmentation fault
Please submit a full bug report, [etc.]
Apart from the segfault, should the code be accepted by the C++ frontend
as well or should it be rejected as it is now?
BTW, the PR was inspired by a question on the gcc mailing list:
http://gcc.gnu.org/ml/gcc/2004-06/msg00158.html
--
Summary: ICE with anonymous unions
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Keywords: ice-on-invalid-code
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15938