[Bug c++/56568] std::initializer_list return value contents lost prematurely
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56568 fuzzyTew at gmail dot com changed: What|Removed |Added CC||fuzzyTew at gmail dot com --- Comment #1 from fuzzyTew at gmail dot com --- Here's an example I ran into using a plain int: http://coliru.stacked-crooked.com/a/1dfad4e209339aa1
[Bug c++/56568] std::initializer_list return value contents lost prematurely
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56568 --- Comment #3 from fuzzyTew at gmail dot com --- The definition of initializer_list is that the array backing it contains copies of the listed values and has the same lifetime as the list itself. If the return value is bound into the object assigned to it, the backing array should stick around as long as the return value does.
[Bug c++/56568] std::initializer_list return value contents lost prematurely
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56568 --- Comment #4 from fuzzyTew at gmail dot com --- I'm not as experienced in the details. I think perhaps my example is invalid as you state but the original testcase is not (see &&).