| 1 |
// { dg-do run } |
| 2 |
|
| 3 |
#include "lib.h" |
| 4 |
|
| 5 |
struct Derived: public Base |
| 6 |
{ |
| 7 |
virtual ~Derived() |
| 8 |
{ printf("In Derived destructor\n"); } |
| 9 |
}; |
| 10 |
|
| 11 |
int main() |
| 12 |
{ |
| 13 |
Derived * d = new Derived; |
| 14 |
Destroy(d); |
| 15 |
Base * pp = GetPrivate(); |
| 16 |
delete pp; // Virtual call #2 |
| 17 |
} |
| 18 |
|