https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103848
--- Comment #9 from Jonathan Wakely <redi at gcc dot gnu.org> --- Either that isn't the correct g++ command, or something in the code you're compiling uses "#pragma GCC diagnostic error ..." to enable the warning. There is no way to get an *error* from a non-default warning in a system header otherwise.