* typeck2.c (check_narrowing): Avoid false positives on conversion
from enumeral type.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-4_7-branch@191398
138bc75d-0d04-0410-961f-
82ee72b054a4
+2012-09-14 Jason Merrill <jason@redhat.com>
+
+ PR c++/53661
+ * typeck2.c (check_narrowing): Avoid false positives on conversion
+ from enumeral type.
+
2012-09-13 Jason Merrill <jason@redhat.com>
PR c++/53839
else if (INTEGRAL_OR_ENUMERATION_TYPE_P (ftype)
&& CP_INTEGRAL_TYPE_P (type))
{
+ if (TREE_CODE (ftype) == ENUMERAL_TYPE)
+ /* Check for narrowing based on the values of the enumeration. */
+ ftype = ENUM_UNDERLYING_TYPE (ftype);
if ((tree_int_cst_lt (TYPE_MAX_VALUE (type),
TYPE_MAX_VALUE (ftype))
|| tree_int_cst_lt (TYPE_MIN_VALUE (ftype),
+2012-09-14 Jason Merrill <jason@redhat.com>
+
+ PR c++/53661
+ * g++.dg/init/aggr9.C: New.
+
2012-09-13 Tobias Burnus <burnus@net-b.de>
PR fortran/54556
--- /dev/null
+// PR c++/53661
+
+enum Code {
+ SUCCESS = 0
+};
+
+Code a;
+
+int r[] = {a};