summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/eh/dtor3.C
blob: ed9e6d9444978b249e7f94c0ab066444e69d6b45 (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
// Red Hat bug 750545
// { dg-do run { target c++98 } }

class excep {};
class A
{
public:
  ~A() { throw excep(); }
};

class B
{
  A a;
};

class C
{
  B b;
};

void f()
{
  C* c = new C();

  try
  {
    delete c;
  }
  catch(...)
  {}
}

int main()
{
  f();
}