summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/init/dtor2.C
blob: 56c7cac914dc7a6911667d73d1559eb883e3e675 (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
// { dg-do run }

extern "C" void abort ();

struct A
{
  ~A();
};

A::~A () {
  abort ();
}

struct B
{
  ~B();
};

B::~B () {
  if(true) return;
  A a;
}

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