This is the mail archive of the
mailing list for the GCC project.
Re: c++ code that egcs kills ...
- To: "Glenn W. Bach" <glenn at dodgson dot wonderland dot caltech dot edu>
- Subject: Re: c++ code that egcs kills ...
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 20 Aug 1998 18:21:51 -0300
- Cc: egcs-bugs at cygnus dot com
- References: <199808201744.KAA11271@dodgson.caltech.edu>
Glenn W Bach <firstname.lastname@example.org> writes:
> Has this been seen before? Is there hope of fixing it in a future version?
> / \
> A D - E
> \ /
> In the above inheritance tree, B and C inherit virtually from A. When an
> object of type E is constructed, D's constructor calls a function in A
> which in turn calls a virtual function overridden by D. This requires a
> downcast from type A to type D, and egcs incorrectly adjusts the object
> pointer, forgetting the size of E's member data.
I believe this is a known problem in the vtable-thunks implementation.
You may work around it by rebuilding libstdc++ with -fno-vtable-thunks
and compiling any C++ program with -fno-vtable-thunks.
Universidade Estadual de Campinas, SP, Brasil