https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105562
--- Comment #19 from Jonathan Wakely <redi at gcc dot gnu.org> --- I suppose the libstdc++ header could do something like: #pragma GCC diagnostic push #if defined __SANITIZE_ADDRESS__ && defined __OPTIMIZE__ #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #endif ... #pragma GCC diagnostic pop