This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
C++ is broken
- To: rth at cygnus dot com
- Subject: C++ is broken
- From: hjl at lucon dot org (H.J. Lu)
- Date: Wed, 29 Jul 1998 08:25:26 -0700 (PDT)
- Cc: egcs-bugs at cygnus dot com
Hi,
C++ is basically broken on certain platforms like Linux/Alpha. The
problem is very tricky. Here is what I found out:
1. egcs 1.0.3 is ok.
2. Linux/Alpha uses thunks and defines ASM_OUTPUT_MI_THUNK.
3. Linux/Alpha generates a global constructor to create vtable.
4. In finish_file () from cp/decl2.c, it does
/* do_ctors will reverse the lists for messing up. */
if (needs_messing_up)
{
do_ctors ();
}
where all the virtual functions in a class is referenced
in the global constructor to create vtable for the class,
including the pure virtual one.
5. But the pure virtual functions are replaced by __pure_virtual
after do_ctors () is called. That leaves the the pure virtual
functions referenced in the global constructor undefined.
We should fix it in egcs 1.1.
Thanks.
H.J.