summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/eh/pr43365.C
blob: 32346d5018cc84135eb0671ea51b89c019922c3b (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
30
extern "C" void abort();

class Counter
{
public:
  static int count;
  ~Counter() { count += 1; }
};

int Counter::count = 0;

void func()
{
  Counter c;

  try {
    throw 1;
  }
  catch (const int&) {
    return;
  }
}

int main()
{
  func();
  if (Counter::count != 1)
    abort();
  return 0;
}