/* -*- C++ -*- */ /************************************************************************* * Copyright(c) 1995~2005 Masaharu Goto (root-cint@cern.ch) * * For the licensing terms see the file COPYING * ************************************************************************/ #include int x=0; class A { int i; public: A() { i=x; printf("A() %d\n",x++); } ~A() { printf("~A() %d\n",i); } }; class B : public A { }; template class C : public A { int i; public: C() { i=x; printf("C() %d\n",x++); } ~C() { printf("~C() %d\n",i); } }; A a; int main() { printf("main()\n"); A b; A *p=&b; a.~A(); b.~A(); p->~A(); B c; c.A::~A(); //c.~A::A(); C d; #if !defined(CINT_HIDE_FAILURE) d.~C(); // this must call both ~C() and ~A(), need to fix this #endif //d.~C::A(); d.A::~A(); printf("end main()\n"); return 0; }