From a32990968ed7264a23f0546123a1384f6a0e4db5 Mon Sep 17 00:00:00 2001 From: Michael Matz Date: Tue, 27 May 2008 14:59:53 +0000 Subject: Fix c++/27975. * c.opt (Wenum-compare): New warning option. * doc/invoke.texi (Warning Options): Document -Wenum-compare. cp/ * call.c (build_new_op): Make warning conditional on OPT_Wenum_compare. testsuite/ * g++.dg/warn/Wenum-compare.C: New testcase. * g++.dg/warn/Wenum-compare-no.C: Ditto. From-SVN: r136035 --- gcc/c.opt | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/c.opt') diff --git a/gcc/c.opt b/gcc/c.opt index 18ce852..9669f2c 100644 --- a/gcc/c.opt +++ b/gcc/c.opt @@ -195,6 +195,10 @@ Wendif-labels C ObjC C++ ObjC++ Warning Warn about stray tokens after #elif and #endif +Wenum-compare +C++ ObjC++ Var(warn_enum_compare) Init(1) Warning +Warn about comparison of different enum types + Werror C ObjC C++ ObjC++ ; Documented in common.opt -- cgit v1.1