typeck.c (type_after_usual_arithmetic_conversions): Prefer a SIZETYPE to a non-SIZETYPE.

* typeck.c (type_after_usual_arithmetic_conversions): Prefer a
        SIZETYPE to a non-SIZETYPE.

From-SVN: r32684
This commit is contained in:
Jason Merrill 2000-03-22 10:12:50 +00:00 committed by Jason Merrill
parent 89fedfc71f
commit 7e9d4b22c9
2 changed files with 11 additions and 0 deletions

View File

@ -1,3 +1,8 @@
2000-03-22 Jason Merrill <jason@casey.cygnus.com>
* typeck.c (type_after_usual_arithmetic_conversions): Prefer a
SIZETYPE to a non-SIZETYPE.
2000-03-21 Mark Mitchell <mark@codesourcery.com>
* class.c (layout_virtual_bases): Adjust names in conditionally

View File

@ -346,6 +346,12 @@ type_after_usual_arithmetic_conversions (t1, t2)
if (code1 != REAL_TYPE)
{
/* If one is a sizetype, use it so size_binop doesn't blow up. */
if (TYPE_IS_SIZETYPE (t1) > TYPE_IS_SIZETYPE (t2))
return build_type_attribute_variant (t1, attributes);
if (TYPE_IS_SIZETYPE (t2) > TYPE_IS_SIZETYPE (t1))
return build_type_attribute_variant (t2, attributes);
/* If one is unsigned long long, then convert the other to unsigned
long long. */
if (same_type_p (TYPE_MAIN_VARIANT (t1), long_long_unsigned_type_node)