2018-10-23 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / g++.dg / eh / uncaught4.C
blob8ca2cd255cae02c11c3d2b83420e2dc514fcda86
1 // PR c++/41174
2 // { dg-do run }
3 // { dg-options "-Wno-deprecated" }
5 #include <exception>
7 #define assert(E) if (!(E)) __builtin_abort();
9 struct e {
10   e()
11   {
12     assert( !std::uncaught_exception() );
13     try {
14       throw 1;
15     } catch (int i) {
16       assert( !std::uncaught_exception() );
17       throw;
18     }
19   }
22 int main()
24   try {
25     throw e();
26   } catch (int i) {
27     assert( !std::uncaught_exception() );
28   }
29   assert( !std::uncaught_exception() );