blob: 330517af697832ca211c7848e68a410e441cf74c [file] [log] [blame]
// PR c++/57510
// { dg-do run { target c++11 } }
#include <initializer_list>
struct counter
{
static int n;
counter() { ++n; }
counter(const counter&) { ++n; }
~counter() { --n; }
};
int counter::n = 0;
struct X
{
X () { if (counter::n > 1) throw 1; }
counter c;
};
int main ()
{
try
{
auto x = { X{}, X{} };
}
catch (...)
{
if ( counter::n != 0 )
throw;
}
}