:ADDPATCH c++: This patch continues the effort to fix PR7651 [1]. A new option -Wenum-promotion takes over the warning for an enumerator and a non-enumerator appearing in a conditional expression. The new option is enabled by -Wextra, so we keep the current behaviour but add the ability to enable/disable this individual warning. Notice that there is an unnamed and unconditional warning about different enumeration types used in conditional expression (see cp/call.c in the patch). That warning is untouched. This patch only gives a name to the warning that is enabled by Wextra. Bootstrapped and regression tested with --enable-languages=all on i686-pc-linux-gnu. OK for mainline? [1] http://gcc.gnu.org/ml/gcc-patches/2006-12/msg01103.html 2007-01-07 Manuel Lopez-Ibanez PR middle-end/7651 * c.opt (Wenum-promotion): New. * doc/invoke.texi (Wenum-promotion): Document it. (Wextra): Enabled by -Wextra. (C++ Language Options): Add it. * c-opts.c (c_common_post_options): Enabled by -Wextra. cp/ 2007-01-07 Manuel Lopez-Ibanez PR middle-end/7651 * call.c (build_conditional_expr): Replace Wextra with Wenum-promotion. testsuite/ 2007-01-07 Manuel Lopez-Ibanez PR middle-end/7651 * g++.old-deja/g++.other/cond5.C: Move enumerators testcases to... * g++.dg/warn/Wenum-promotion.C: ... here. New. * g++.dg/warn/Wenum-promotion-no.C: ... here. New. * g++.dg/warn/Wenum-promotion-Wextra.C: ... here. New.