struct B { ~B() { cerr << "~B()" << endl; } }; struct D : public B { ~D() { cerr << "~D()" << endl; } }; int main() { D d; return 0; }