Fortran: Fix PR 47485.
[gcc.git] / gcc / testsuite / g++.dg / cpp0x / initlist-nrv1.C
blobe44dbecfece4ffbbf8552c65d3669ed62fba0dac
1 // PR c++/101442
2 // { dg-do run { target c++11 } }
4 bool destroyed = false;
6 struct A
8   A() {}
9   A(const A &) = delete;
10   A &operator=(const A &) = delete;
11   ~A() {destroyed = true;}
14 struct B
16   const A &a;
17   struct string {
18     string(const char*) { }
19     ~string() { }
20   } s;
23 B foo()
25   B ret{ A{}, "" };
26   return ret;
29 int main()
31   B b = foo();
32   if (!destroyed)
33     __builtin_abort();