[Bug tree-optimization/126346] False positive "may be used uninitialized" with -O3, std::variant and std::string

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jul 22 02:22:42 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126346

--- Comment #2 from Drea Pinski <pinskia at gcc dot gnu.org> ---
>-fsanitize=undefined

The full one without -fsanitize=undefined is a different issue than with.  In
fact with, the following is in the documentation:
From
https://gcc.gnu.org/onlinedocs/gcc-16.1.0/gcc/Instrumentation-Options.html#index-fsanitize_003dundefined
:
```
Note that sanitizers tend to increase the rate of false positive warnings, most
notably those around -Wmaybe-uninitialized. We recommend against combining
-Werror and [the use of] sanitizers.

```


More information about the Gcc-bugs mailing list