Retro68/gcc/libvtv/testsuite/libvtv.cc/derived-main.cpp

19 lines
254 B
C++
Raw Normal View History

2014-09-21 17:33:12 +00:00
// { dg-do run }
#include "lib.h"
struct Derived: public Base
{
virtual ~Derived()
{ printf("In Derived destructor\n"); }
};
int main()
{
Derived * d = new Derived;
Destroy(d);
Base * pp = GetPrivate();
delete pp; // Virtual call #2
}