]> gcc.gnu.org Git - gcc.git/commitdiff
typeck.c (type_after_usual_arithmetic_conversions): Prefer a SIZETYPE to a non-SIZETYPE.
authorJason Merrill <jason@casey.cygnus.com>
Wed, 22 Mar 2000 10:12:50 +0000 (10:12 +0000)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 22 Mar 2000 10:12:50 +0000 (05:12 -0500)
        * typeck.c (type_after_usual_arithmetic_conversions): Prefer a
        SIZETYPE to a non-SIZETYPE.

From-SVN: r32684

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

index 36dca353b803c931562215b77744948a08cc1c14..de6a2ebd80440cbef4f2b4e3fbd00392923d727f 100644 (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
index 2a239604479851ea49cfd7563300a5cfa26e678a..fe6d2664b9006cb3e8eac8e07486eff0a1ce96b4 100644 (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)
This page took 0.085293 seconds and 5 git commands to generate.