This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/35748] New: ICE with cast to invalid union
- 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: 28 Mar 2008 22:02:29 -0000
- Subject: [Bug c/35748] New: ICE with cast to invalid union
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following invalid code snippet triggers an ICE since at least GCC 2.95.3:
=================================
union U { void x[1]; };
void foo()
{
(union U)0;
}
=================================
bug.c:1: error: declaration of 'x' as array of voids
bug.c: In function 'foo':
bug.c:5: internal compiler error: tree check: expected class 'type', have
'exceptional' (error_mark) in build_c_cast, at c-typeck.c:3631
Please submit a full bug report, [etc.]
--
Summary: ICE with cast to invalid union
Product: gcc
Version: 4.4.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=35748