[Bug libstdc++/102573] optimized code removes the underlying elements of the std::initializer_list being copied

2021-10-03 Thread 13508417 at qq dot com via Gcc-bugs
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 (

[Bug libstdc++/102573] optimized code removes the underlying elements of the std::initializer_list being copied

2021-10-02 Thread 13508417 at qq dot com via Gcc-bugs
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

[Bug libstdc++/102573] New: optimized code removes the underlying elements of the std::initializer_list being copied

2021-10-02 Thread 13508417 at qq dot com via Gcc-bugs
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