From: rguenth Date: Mon, 29 Sep 2014 10:42:16 +0000 (+0000) Subject: 2014-09-29 Richard Biener X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=033c0b511be65ff0c5d47f158789e9e08d471b7e;p=thirdparty%2Fgcc.git 2014-09-29 Richard Biener cp/ * typeck.c (enum_cast_to_int): Use CONVERT_EXPR_P to check for conversions. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@215681 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 126c14836b4a..0beb9974521c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2014-09-29 Richard Biener + + * typeck.c (enum_cast_to_int): Use CONVERT_EXPR_P to check + for conversions. + 2014-09-26 Jason Merrill * mangle.c (find_substitution): Use write_abi_tags. diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index aa82f1c0a78f..61d52bdb8332 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -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))))