https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126346
Bug ID: 126346
Summary: False positive "may be used uninitialized" with -O3,
std::variant and std::string
Product: gcc
Version: 16.1.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: gcc at cohi dot at
Target Milestone: ---
Created attachment 65109
--> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65109&action=edit
PEGTL-repro
Another variant of the "may be used uninitialized" bug in conjunction with -O3
and a std::string inside a std::variant, filing separately as requested here
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107138#c21
I can provoke the false positive with GCC 16.1.0 on macOS in two ways:
- With the small repdroducer from 107138 which needs -O3 and
-fsanitize=undefined.
- With the PEGTL with only -O3 (have not been able to find a smaller repro
yet).
Attached file is the preprocessed PEGTL source that provokes the problem and
the compiler output.