blob: bf3cb094e0f5952635a31fa931c9de90f0923f6d [file] [log] [blame]
// PR c++/67711, 48562
// { dg-do compile { target c++11 } }
#include <initializer_list>
using IL = std::initializer_list<int>;
int main()
{
IL il = { 1,2,3 };
il = { 4,5,6 }; // { dg-warning "initializer_list" }
// the array is dead, il now points to garbage
il = *new IL{ 7, 8, 9 }; // { dg-warning "initializer_list" }
// the array is dead, il now points to garbage
return *il.begin(); // undefined
}