+2011-08-08 Jason Merrill <jason@redhat.com>
+
+ PR c++/50011
+ * typeck2.c (check_narrowing): Fix integer logic.
+
2011-08-08 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
* Make-lang.in (g++$(exeext)): Add $(EXTRA_GCC_LIBS).
else if (INTEGRAL_OR_ENUMERATION_TYPE_P (ftype)
&& CP_INTEGRAL_TYPE_P (type))
{
- if ((TYPE_PRECISION (type) < TYPE_PRECISION (ftype)
- || TYPE_UNSIGNED (type) != TYPE_UNSIGNED (ftype))
+ if ((tree_int_cst_lt (TYPE_MAX_VALUE (type),
+ TYPE_MAX_VALUE (ftype))
+ || tree_int_cst_lt (TYPE_MIN_VALUE (ftype),
+ TYPE_MIN_VALUE (type)))
&& (TREE_CODE (init) != INTEGER_CST
|| !int_fits_type_p (init, type)))
ok = false;