https://gcc.gnu.org/bugzilla/show_bug.cgi?id=122054
Bug ID: 122054
Summary: Spurious "may be used uninitialized" warning
Product: gcc
Version: 15.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: sebastien at debian dot org
Target Milestone: ---
Created attachment 62443
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62443&action=edit
Source code
When compiling the attached code snippet with: -std=gnu++20 -O -g
-Wuninitialized
One gets a spurious uninitialized warning (see attached output).
Note that the warning disappears when either -O or -g is dropped.
This is experienced with g++-15 15.2.0-4 from Debian unstable/sid
(corresponding to the gcc-15 branch as of 2025-09-11).