aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/eh/uncaught4.C
blob: 227d11b330bbb35cc6e72a13b9cabe816bc0f84f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// PR c++/41174
// { dg-do run }

#include <exception>

#define assert(E) if (!(E)) __builtin_abort();

struct e {
  e()
  {
    assert( !std::uncaught_exception() );
    try {
      throw 1;
    } catch (int i) {
      assert( !std::uncaught_exception() );
      throw;
    }
  }
};

int main()
{
  try {
    throw e();
  } catch (int i) {
    assert( !std::uncaught_exception() );
  }
  assert( !std::uncaught_exception() );
}