diff options
author | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-03-22 10:12:50 +0000 |
---|---|---|
committer | jason <jason@138bc75d-0d04-0410-961f-82ee72b054a4> | 2000-03-22 10:12:50 +0000 |
commit | 99c97acbf363f34ea809496bc83e275af6e1d75a (patch) | |
tree | f229c06a4de38056a6d1127b3e809c9e20cb34c0 | |
parent | d07b7d6dfae660897d2a0eb93cd19293d82c6362 (diff) | |
download | ppe42-gcc-99c97acbf363f34ea809496bc83e275af6e1d75a.tar.gz ppe42-gcc-99c97acbf363f34ea809496bc83e275af6e1d75a.zip |
* typeck.c (type_after_usual_arithmetic_conversions): Prefer a
SIZETYPE to a non-SIZETYPE.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32684 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 36dca353b80..de6a2ebd804 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 2a239604479..fe6d2664b90 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) |