This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

C++: __java_double expressions promote to float


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,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]