virtual destructors
Jessica Han
jessica at cup.hp.com
Thu Aug 1 20:06:32 UTC 2002
I have a simple testcase test.C
class base_class
{
public:
virtual void showmanyc () { };
virtual ~base_class(){};
virtual void underflow(){};
};
int main(){
base_class A;
}
If I compile it with aCC on IPF HPUX, I get the vtable for base_class looks
like:
vtable for base_class:: data1 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00
data4.ua typeinfo for base_class
data1 0x00, 0x00, 0x00, 0x00
data16.ua @iplt(base_class::showmanyc())
data16.ua @iplt(base_class::underflow())
data16.ua @iplt(base_class::~base_class [in-charge]())
data16.ua @iplt(base_class::~base_class [in-charge deleting]())
If I compile it with gcc on the same machine, I get the following vtable:
vtable for base_class:
data4 0
data4 0
data4 typeinfo for base_class#
data4 0
data8.ua @iplt(base_class::showmanyc()#)
data8.ua 0
data8.ua @iplt(base_class::~base_class [in-charge]()#)
data8.ua 0
data8.ua @iplt(base_class::~base_class [in-charge deleting]()#)
data8.ua 0
data8.ua @iplt(base_class::underflow()#)
data8.ua 0
aCC always puts virtual destructors at the bottom of the vtable, but g++
puts them in the order of its definition. What is the right order of
function descriptors? Since I already declared base_class::~base_class, it
is not implicitly-defined virtual destructor, right?
Thanks.
----
Jessica Han
Open Source Tools
Hewlett-Packard
(408) 447-6154
More information about the cxx-abi-dev
mailing list