fold-const.c (fold_convertible_p): Correct the logic to follow that in fold_convert().

* fold-const.c (fold_convertible_p): Correct the logic to follow
	that in fold_convert().

From-SVN: r132780
This commit is contained in:
Francois-Xavier Coudert 2008-02-29 23:01:22 +01:00 committed by François-Xavier Coudert
parent f31c9f09a1
commit c17ee676e5
2 changed files with 13 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2008-02-29 Francois-Xavier Coudert <coudert@clipper.ens.fr>
* fold-const.c (fold_convertible_p): Correct the logic to follow
that in fold_convert().
2008-02-29 Douglas Gregor <doug.gregor@gmail.com>
PR c++/35315

View File

@ -2475,8 +2475,15 @@ fold_convertible_p (const_tree type, const_tree arg)
return (TREE_CODE (orig) == VECTOR_TYPE
&& tree_int_cst_equal (TYPE_SIZE (type), TYPE_SIZE (orig)));
default:
case REAL_TYPE:
case FIXED_POINT_TYPE:
case COMPLEX_TYPE:
case VECTOR_TYPE:
case VOID_TYPE:
return TREE_CODE (type) == TREE_CODE (orig);
default:
return false;
}
}