aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/typeck.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 36dca35..de6a2eb 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c
index 2a23960..fe6d266 100644
--- a/gcc/cp/typeck.c
+++ b/gcc/cp/typeck.c
@@ -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)