This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH RFA: -Wc++-compat: different enums in ?:
- From: "Joseph S. Myers" <joseph at codesourcery dot com>
- To: Ian Lance Taylor <iant at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 19 Jun 2009 20:43:54 +0000 (UTC)
- Subject: Re: PATCH RFA: -Wc++-compat: different enums in ?:
- References: <m3ljnokmnv.fsf@google.com>
On Fri, 19 Jun 2009, Ian Lance Taylor wrote:
> When doing the big -Wc++-compat enum fixes a while back, I overlooked a
> case. In C++, the ?: operator does not permit the second and third
> operands to have different enum types. This patch adds a warning for
> this case for -Wc++-compat. This patch requires approval from the C
> frontend maintainers.
>
> This patch also fixes the single case in the gcc sources where this
> problem arises.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu. OK for mainline?
The C changes are OK.
--
Joseph S. Myers
joseph@codesourcery.com