2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / eh / dtor1.C
blob4fafdde24d206a1dedc53db8bbc298b7b30f4268
1 // PR c++/411
3 // Test that a fully-constructed base is destroyed before transferring
4 // control to the handler of a function-try-block.
6 // { dg-do run }
8 int ad;
9 int r;
11 struct A {
12   ~A() { ++ad; }
15 struct B: public A {
16   ~B();
19 B::~B ()
20 try
21   {
22     throw 1;
23   }
24 catch (...)
25   {
26     if (!ad)
27       r = 1;
28     return;
29   }
31 int main ()
33   { B b; }
34   return r;