Debian Codegraph @

gcc/testsuite/g++.dg/eh/pr43365.C

raw
1 extern "C" void abort();
2
3 class Counter
4 {
5 public:
6 static int count;
7 ~Counter() { count += 1; }
8 };
9
10 int Counter::count = 0;
11
12 void func()
13 {
14 Counter c;
15
16 try {
17 throw 1;
18 }
19 catch (const int&) {
20 return;
21 }
22 }
23
24 int main()
25 {
26 func();
27 if (Counter::count != 1)
28 abort();
29 return 0;
30 }