typeck.c (enum_cast_to_int): Use CONVERT_EXPR_P to check for conversions.
authorRichard Biener <rguenther@suse.de>
Mon, 29 Sep 2014 10:42:16 +0000 (10:42 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 29 Sep 2014 10:42:16 +0000 (10:42 +0000)
2014-09-29  Richard Biener  <rguenther@suse.de>

cp/
* typeck.c (enum_cast_to_int): Use CONVERT_EXPR_P to check
for conversions.

From-SVN: r215681

gcc/cp/ChangeLog
gcc/cp/typeck.c

index 126c14836b4af51763d4abf498323563678ee196..0beb9974521c3081992746b24d17a56a8ab9a4d7 100644 (file)
@@ -1,3 +1,8 @@
+2014-09-29  Richard Biener  <rguenther@suse.de>
+
+       * typeck.c (enum_cast_to_int): Use CONVERT_EXPR_P to check
+       for conversions.
+
 2014-09-26  Jason Merrill  <jason@redhat.com>
 
        * mangle.c (find_substitution): Use write_abi_tags.
index aa82f1c0a78fc4726d02dc5079d2726de4e0d7f6..61d52bdb8332a6c70a9110f3f98c5c17e7d2af23 100644 (file)
@@ -3835,7 +3835,7 @@ build_x_array_ref (location_t loc, tree arg1, tree arg2,
 static bool
 enum_cast_to_int (tree op)
 {
-  if (TREE_CODE (op) == NOP_EXPR
+  if (CONVERT_EXPR_P (op)
       && TREE_TYPE (op) == integer_type_node
       && TREE_CODE (TREE_TYPE (TREE_OPERAND (op, 0))) == ENUMERAL_TYPE
       && TYPE_UNSIGNED (TREE_TYPE (TREE_OPERAND (op, 0))))