c++: prvalue of array type [PR111286]
[official-gcc.git] / gcc / testsuite / g++.dg / cpp0x / initlist116.C
blob90dd8d70d63afad1024f3b6d0130266f7474a731
1 // PR c++/66139
2 // { dg-do run { target c++11 } }
4 int constructed = 0;
6 class lock_guard_ext{
7 public:
8   lock_guard_ext() { ++constructed; }
9   ~lock_guard_ext() { --constructed; }
12 struct Access {
13   lock_guard_ext lock;
14   int value;
17 int t() {
18   throw 0;
21 Access foo1() {
22   return { {}, t() };
25 int main () {
26   try { foo1(); } catch (int) {}
27   if (constructed != 0)
28     __builtin_abort();