Debian Codegraph @

gcc/testsuite/g++.dg/cpp0x/initlist116.C

raw
1 // PR c++/66139
2 // { dg-do run { target c++11 } }
3
4 int constructed = 0;
5
6 class lock_guard_ext{
7 public:
8 lock_guard_ext() { ++constructed; }
9 ~lock_guard_ext() { --constructed; }
10 };
11
12 struct Access {
13 lock_guard_ext lock;
14 int value;
15 };
16
17 int t() {
18 throw 0;
19 }
20
21 Access foo1() {
22 return { {}, t() };
23 }
24
25 int main () {
26 try { foo1(); } catch (int) {}
27 if (constructed != 0)
28 __builtin_abort();
29 }