[PATCH][C++] Make __java_boolean a true bool (PR 33887)

Richard Guenther rguenther@suse.de
Tue Jan 29 15:47:00 GMT 2008


On Tue, 29 Jan 2008, Richard Guenther wrote:

> 2008-01-29  Richard Guenther  <rguenther@suse.de>
> 
> 	Revert
> 	PR c++/33887
> 	* decl.c (record_builtin_java_type): Make __java_boolean
> 	a variant of bool.
> 	* typeck.c (structural_comptypes): Move TYPE_FOR_JAVA check
> 	after TYPE_MAIN_VARIANT check.
> 
> 	* typeck.c (build_unary_op): Reject -- on all boolean types.
> 	* decl.c (record_builtin_java_type): Make __java_boolean
> 	a BOOLEAN_TYPE.
> 	* cvt.c (type_promotes_to): All BOOLEAN_TYPEs promote to int.
> 	* mangle.c (write_template_arg_literal): All BOOLEAN_TYPE
> 	constants should be either one or zero.
> 
...

> *** decl.c	(revision 131937)
> --- decl.c	(working copy)
> *************** record_builtin_java_type (const char* na
> *** 3161,3167 ****
>       type = make_signed_type (size);
>     else if (size == -1)
>       { /* "__java_boolean".  */
> !       type = build_variant_type_copy (boolean_type_node);
>       }
>     else if (size > -32)
>       { /* "__java_char".  */
> --- 3161,3168 ----
>       type = make_signed_type (size);
>     else if (size == -1)
>       { /* "__java_boolean".  */
> !       type = make_unsigned_type (1);
> !       TREE_SET_CODE (type) = BOOLEAN_TYPE;
>       }

TREE_SET_CODE (type, BOOLEAN_TYPE);

of course.

Richard.



More information about the Gcc-patches mailing list