libgomp.texi: Fix deprecation note for omp_{get,set}_nested + OMP_NESTED
[official-gcc.git] / gcc / testsuite / g++.dg / eh / filter2.C
blobe8f96cfd4e60ce2f23f2d5e6e6e7c3dd548c0859
1 // Test that terminate gets run when a catch filter fails to match while
2 // running destructors.  Original bug depended on a::~a being inlined.
3 // { dg-do run }
4 // { dg-options -O }
5 // { dg-skip-if "requires hosted libstdc++ for cstdlib abort" { ! hostedlib } }
7 #include <exception>
8 #include <cstdlib>
10 struct e1 {};
11 struct e2 {};
13 struct a
15   a () { }
17   ~a ()
18     {
19       try
20         {
21           throw e1();
22         }
23       catch (e2 &)
24         {
25         }
26     }
29 void
30 ex_test ()
32   a aa;
33   try
34     {
35       throw e1 ();
36     }
37   catch (e2 &)
38     {
39     }
42 void my_terminate ()
44   std::exit (0);
47 int
48 main ()
50   std::set_terminate (my_terminate);
52   try
53     {
54       ex_test ();
55     }
56   catch (...)
57     {
58     }
59   abort ();