+2012-06-04 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/53524
+ * doc/invoke.texi (Wenum-compare): Update documentation.
+
2012-06-04 Dodji Seketeli <dodji@redhat.com>
PR preprocessor/53463
+2012-06-04 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/53524
+ * call.c (build_conditional_expr_1): Use OPT_Wenum_compare
+ to control enumeral mismatch in conditional expression too.
+
2012-06-04 Steven Bosscher <steven@gcc.gnu.org>
* semantics.c: Do not include output.h.
&& TREE_CODE (arg3_type) == ENUMERAL_TYPE)
{
if (complain & tf_warning)
- warning (0,
+ warning (OPT_Wenum_compare,
"enumeral mismatch in conditional expression: %qT vs %qT",
arg2_type, arg3_type);
}
@item -Wenum-compare
@opindex Wenum-compare
@opindex Wno-enum-compare
-Warn about a comparison between values of different enumerated types. In C++
-this warning is enabled by default. In C this warning is enabled by
-@option{-Wall}.
+Warn about a comparison between values of different enumerated types.
+In C++ enumeral mismatches in conditional expressions are also
+diagnosed and the warning is enabled by default. In C this warning is
+enabled by @option{-Wall}.
@item -Wjump-misses-init @r{(C, Objective-C only)}
@opindex Wjump-misses-init
+2012-06-04 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/53524
+ * g++.dg/warn/Wenum-compare-no-2: New.
+
2012-06-04 Dodji Seketeli <dodji@redhat.com>
PR preprocessor/53463
--- /dev/null
+// PR c++/53524
+// { dg-options "-Wno-enum-compare" }
+
+template < typename > struct PointerLikeTypeTraits {
+ enum { NumLowBitsAvailable };
+};
+
+class CodeGenInstruction;
+class CodeGenInstAlias;
+
+template < typename T>
+struct PointerIntPair {
+ enum { IntShift = T::NumLowBitsAvailable };
+};
+
+template < typename PT1, typename PT2 > struct PointerUnionUIntTraits {
+ enum {
+ PT1BitsAv = PointerLikeTypeTraits < PT1 >::NumLowBitsAvailable,
+ PT2BitsAv = PointerLikeTypeTraits < PT2 >::NumLowBitsAvailable,
+ NumLowBitsAvailable = 0 ? PT1BitsAv : PT2BitsAv
+ };
+};
+
+template < typename PT1, typename PT2 > class PointerUnion {
+ typedef PointerIntPair < PointerUnionUIntTraits < PT1, PT2 > > ValTy;
+ ValTy Val;
+};
+
+struct ClassInfo {
+ PointerUnion < CodeGenInstruction *, CodeGenInstAlias * > DefRec;
+};