https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98690
Bug ID: 98690
Summary: unexpected "'removed_return.213' may be used
uninitialized in this function" causes crash
Product: gcc
Version: 10.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: savoiu at yahoo dot com
Target Milestone: ---
Created attachment 49968
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=49968&action=edit
code exhibiting bug
When compiling the attached code I get:
error: 'removed_return.213' may be used uninitialized in this function
[-Werror=maybe-uninitialized]
and the error points to the 'endl' in that line.
If I downgrade the "maybe-uninitialized" to just a warning then it compiles but
the code crashes on that line.
The command line is:
g++ -fnon-call-exceptions -Wmaybe-uninitialized -O2 gcc10bug.cpp
gcc10bug_main.cpp
If I remove -fnon-call-exceptions the the code compiles and runs as expected.
The code also runs just fine with GCC 9.1.0.