https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102482

--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> ---
And the fabulous manual:

> warn about uses of "std::initializer_list" that are likely to result in
> dangling pointers

This is behaving exactly as documented:

> *   When a list constructor stores the "begin" pointer from the
>     "initializer_list" argument, this doesn't extend the lifetime of
>     the array, so if a class variable is constructed from a temporary
>     "initializer_list", the pointer is left dangling by the end of the
>     variable declaration statement.

Reply via email to