aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/opt/vt3.C
blob: 0cef67206e012656a10f77ddc6d18e5be8f80a51 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
// PR c++/34949
// { dg-do compile }
// { dg-options "-O3" }

struct E {};
struct A
{
  virtual void a (void *) = 0;
};
struct B
{
  virtual ~B () {};
  unsigned int b1;
  E **b2;
  A *b3;
};
struct C : public B
{
  ~C ();
};
C::~C ()
{
  for (unsigned int i = 0; i < b1; i++)
    b3->a (b2);
}
struct D
{
  ~D () {}
  C d;
};
struct F { virtual ~F () {}; };
struct G { void g (); };
struct H : public F
{
  virtual ~H ();
  D *h1;
  G *h2;
};
H::~H ()
{
  h2->g ();
  delete h1;
}