This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/36410] New: [4.1/4.2/4.3/4.4 regression] ICE with transparent 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: 1 Jun 2008 11:03:28 -0000
- Subject: [Bug c++/36410] New: [4.1/4.2/4.3/4.4 regression] ICE with transparent union
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The following code snippet triggers an ICE since GCC 4.3.0:
===========================================
struct A
{
typedef union
{
int i;
} B __attribute__((transparent_union));
};
void foo(A::B b)
{
b.i;
}
===========================================
bug.cc: In function 'void foo(A::B)':
bug.cc:11: internal compiler error: in build_base_path, at cp/class.c:272
Please submit a full bug report, [etc.]
GCC 4.2.x emits the following error message:
bug.cc:9: error: non-local function 'void foo(A::<anonymous union>)' uses
anonymous type
GCC 4.1.x also crashes, GCC 3.1 - GCC 4.0.4 reject the code,
and GCC 2.95.x - 3.0.4 accept the code.
Without the attribute the code compiles fine with all versions.
I'm not quite sure whether the code is valid or not. Is A::B really an
anonymous type as the error message in GCC 4.2.x suggests? It has a name
(A::B) after all.
If the code is valid we have a regression since GCC 3.1, if it is invalid we
have a 4.1/4.3/4.4 regression.
--
Summary: [4.1/4.2/4.3/4.4 regression] ICE with transparent union
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Keywords: ice-on-valid-code, 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=36410