blob: bcc9b9ad5f7be54690c0575d2902a80c766da0d1 [file] [log] [blame]
// Test for throwing bad_array_new_length on invalid array length
// { dg-do run { target c++11 } }
#include <new>
void * f(int i)
{
return new int[i]{1,2,3,4};
}
int main()
{
f(4); // OK
try
{
f(3);
}
catch (std::bad_array_new_length) { return 0; }
__builtin_abort ();
}