https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102573
--- Comment #4 from wjf <13508417 at qq dot com> ---
Hi Andrew,
I've updated my gcc to 10.2.1, and find while it did show what you said for my
initial code snippet, it won't warn me anything, nor report error at runtime
with -fsanitize=address (
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102573
--- Comment #2 from wjf <13508417 at qq dot com> ---
(In reply to Andrew Pinski from comment #1)
> GCC warns:
> : In function 'int main()':
> :9:19: warning: assignment from temporary 'initializer_list' does
> not extend the lifetime of the under
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102573
Bug ID: 102573
Summary: optimized code removes the underlying elements of the
std::initializer_list being copied
Product: gcc
Version: 4.8.5
Status: UNCONFIRMED