2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.dg / eh / filter1.C
blob6ff0574c2a3d0745353a265ee4b17bdf824067d7
1 // Test that cleanups get run when a catch filter fails to match.
2 // { dg-do run }
4 extern "C" void exit(int);
5 extern "C" void abort();
7 struct a
9   a();
10   ~a();
13 struct e1 {};
14 struct e2 {};
16 void
17 ex_test ()
19   a aa;
20   try
21     {
22       throw e1 ();
23     }
24   catch (e2 &)
25     {
26     }
29 int
30 main ()
32   try
33     {
34       ex_test ();
35     }
36   catch (...)
37     {
38     }
39   abort ();
42 a::a() { }
43 a::~a() { exit (0); }