summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/torture/pr47382.C
blob: a12dbe3fd09ecb6252032a9ada0e78c637d40355 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// { dg-do run }

extern "C" void abort ();

struct A
{
  inline ~A ();
  virtual void foo () {}
};

struct B : A
{
  virtual void foo () { abort(); }
};

static inline void middleman (A *a)
{
  a->foo ();
}

inline A::~A ()
{
  middleman (this);
}

int main ()
{
   B b;
   return 0;
}