Debian Codegraph @

gcc/testsuite/g++.dg/init/array66.C

raw
1 // PR c++/117827
2 // { dg-do run { target c++11 } }
3
4 struct C {
5 int c;
6 static int d, e;
7 C () : c (0) { ++d; }
8 C (const C &) = delete;
9 C &operator= (const C &) = delete;
10 ~C () { ++e; }
11 };
12 int C::d, C::e;
13
14 C *
15 foo (C *p)
16 {
17 delete[] p;
18 throw 1;
19 }
20
21 int
22 main ()
23 {
24 try
25 {
26 foo (new C[1] {});
27 }
28 catch (...)
29 {
30 }
31 if (C::d != C::e)
32 __builtin_abort ();
33 }