class A { public: A() {} ~A(){} }; class B: public A { public: B():A(){} ~B(){} }; int main(void) { A* a = new B(); delete a; }