C++: __java_double expressions promote to float
Andrew Haley
aph@cambridge.redhat.com
Tue Apr 9 11:15:00 GMT 2002
TYPE_MAIN_VARIANT for __java_double is __java_double.
type_after_usual_arithmetic_conversions() doesn't know anything about
that type, so it converts to float. Therefore, expressions whose
operands are all of type __java_double are of type float. I think
that's wrong...
Andrew.
2002年04月09日 Andrew Haley <aph@cambridge.redhat.com>
* typeck.c (type_after_usual_arithmetic_conversions):
__java_double expressions promote to __java_double, not float.
Index: typeck.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/typeck.c,v
retrieving revision 1.393
diff -c -2 -p -r1.393 typeck.c
*** typeck.c 22 Mar 2002 22:03:04 -0000 1.393
--- typeck.c 9 Apr 2002 17:46:18 -0000
*************** type_after_usual_arithmetic_conversions
*** 443,446 ****
--- 443,450 ----
return build_type_attribute_variant (double_type_node,
attributes);
+ if (same_type_p (TYPE_MAIN_VARIANT (t1), java_double_type_node)
+ || same_type_p (TYPE_MAIN_VARIANT (t2), java_double_type_node))
+ return build_type_attribute_variant (java_double_type_node,
+ attributes);
else
return build_type_attribute_variant (float_type_node,
More information about the Java
mailing list