>Number: 10893
>Category: c++
>Synopsis: wrong class mapping for empty bases
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Wed May 21 02:36:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator: Yan Liu
>Release: unknown-1.0
>Organization:
>Environment:
linuxppc system, version 3.2 32bit mode.
>Description:
>How-To-Repeat:
using -fdump-class-hierarchy option to get the class layout of the above testcase. You will find the empty base class E1 and E are at offset 4 in struct D1 class layout. There is a another data member also be mapped at the same address, which is wrong according to C++ ABI.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted:
----gnatsweb-attachment----
Content-Type: text/plain; name="kaka.C"
Content-Disposition: inline; filename="kaka.C"
struct E {};
struct E1: public E {};
struct E2: public E {};
struct D: public virtual E1, public E2 {
};
struct D1: public D {
int d1;
};
D1 objd1;
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.