[Bug middle-end/124060] -Werror=complain-wrong-lang doesn't work for "... is not valid for C++"

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Feb 11 01:25:19 GMT 2026


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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|driver                      |middle-end

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I am not sure only adding OPT_Wcomplain_wrong_lang will work because the order
of the processing of the options here.

We warn as we process the option rather than delay until all options are
processed. 

Is if -Werror=complain-wrong-lang was first on the command line you would get
an error but since it is last, then you just get a warning.
Maybe we should delay the warning until after we process all options. Maybe
that is the best ...


More information about the Gcc-bugs mailing list