summaryrefslogtreecommitdiff
path: root/libvtv/testsuite/libvtv.cc/derived-main.cpp
blob: 0933ff696210d7da4803977ea304a70cc66bd5dc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// { 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
}