Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.dg / eh / unexpected1.C
blobe5982ffacc5cced8a8228fd0b48d97238098202b
1 // PR 3719
2 // Test that an unexpected handler can rethrow to categorize.
3 // { dg-do run }
5 #include <exception>
7 extern "C" void abort ();
9 struct One { };
10 struct Two { };
12 static void
13 handle_unexpected ()
15   try
16   {
17     throw;
18   }
19   catch (One &)
20   {
21     throw Two ();
22   }
25 static void
26 doit () throw (Two)
28   throw One ();
31 int main ()
33   std::set_unexpected (handle_unexpected);
35   try
36   {
37     doit ();
38   }
39   catch (Two &)
40   {
41   }
42   catch (...)
43   {
44     abort ();
45   }