Incorrect statement in C++ ABI

michaelw at ca.ibm.com michaelw at ca.ibm.com
Tue Aug 27 04:30:08 UTC 2002


In the C++ ABI document Section 1.1 Definitions, the nearly empty class has
at most one nearly empty non-virtual proper base. This does  not seem to be
true.

By that definition class C is not nearly empty in the hierarchy

   class A { virtual void a(); };

   class B: public A  { virtual void b(); };

   class C: public B  { virtual void c(); };

since it has two non-virtual nearly empty proper bases B and A.

By the basic idea that nearly empty class should only have pointer to the
Virtual table, class C should be nearly empty, since class B is primary to
C and A is primary to B, so they all share the same pointer to the VT. G++
compiles C as nearly empty.

Michael Wong
VisualAge C++ Compiler kernel Development
IBM Canada Ltd., C2/KD2/8200/MKM
8200 Warden Avenue
Markham, Ontario  L6G 1C7
W:905-413-3283 F:905-413-4839




More information about the cxx-abi-dev mailing list