This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/18378] New: ICE when returning a copy of a packed member
- From: "jdboyer at mediatrix dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Nov 2004 17:23:56 -0000
- Subject: [Bug c++/18378] New: ICE when returning a copy of a packed member
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Defining a class method which returns a copy of one of its members, and this
member is declared "packed", and this member is from another class type, causes
an internal compiler error when this method is called.
The bug was verified on both gcc 3.4.2 and 3.4.3, on i686-linux and powerpc-
linux.
The following simple program will crash g++ when compiled with -DSHOW_ICE.
---------------------------------------------------------------------------
class A
{
public:
int i;
A() {}
A(const A& a) { i = a.i; }
};
class B
{
#ifdef SHOW_ICE
A a __attribute__((packed));
#else
A a;
#endif
public:
B() {}
A GetA() { return a; }
};
int main()
{
B b;
return b.GetA().i;
}
---------------------------------------------------------------------------
Jean-Denis Boyer,
Mediatrix Telecom Inc.
--
Summary: ICE when returning a copy of a packed member
Product: gcc
Version: 3.4.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: jdboyer at mediatrix dot com
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18378