Commit a6967cc0 by Jason Merrill Committed by Jason Merrill

decl.c (init_decl_processing): Give null_node unknown* type.

	* decl.c (init_decl_processing): Give null_node unknown* type.
	* typeck.c (comp_target_types): Handle UNKNOWN_TYPE.
	(common_type): Likewise.
	* error.c (args_as_string): Recognize null_node.

From-SVN: r16100
parent 3a133c72
Mon Oct 20 10:52:22 1997 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (init_decl_processing): Give null_node unknown* type.
* typeck.c (comp_target_types): Handle UNKNOWN_TYPE.
(common_type): Likewise.
* error.c (args_as_string): Recognize null_node.
Thu Oct 16 15:31:09 1997 Judy Goldberg <judygold@sanwafp.com>
* pt.c (determine_explicit_specialization): Initialize "dummy"
......
......@@ -4998,11 +4998,6 @@ init_decl_processing ()
TREE_TYPE (null_pointer_node) = build_pointer_type (void_type_node);
layout_type (TREE_TYPE (null_pointer_node));
if (flag_ansi)
TREE_TYPE (null_node) = type_for_size (POINTER_SIZE, 0);
else
TREE_TYPE (null_node) = build_pointer_type (void_type_node);
/* Used for expressions that do nothing, but are not errors. */
void_zero_node = build_int_2 (0, 0);
TREE_TYPE (void_zero_node) = void_type_node;
......@@ -5315,7 +5310,14 @@ init_decl_processing ()
TYPE_MODE (unknown_type_node) = TYPE_MODE (void_type_node);
/* Indirecting an UNKNOWN_TYPE node yields an UNKNOWN_TYPE node. */
TREE_TYPE (unknown_type_node) = unknown_type_node;
/* Looking up TYPE_POINTER_TO and TYPE_REFERENCE_TO yield the same result. */
if (flag_ansi)
TREE_TYPE (null_node) = type_for_size (POINTER_SIZE, 0);
else
TREE_TYPE (null_node) = build_pointer_type (unknown_type_node);
/* Looking up TYPE_POINTER_TO and TYPE_REFERENCE_TO yield the same
result. */
TYPE_POINTER_TO (unknown_type_node) = unknown_type_node;
TYPE_REFERENCE_TO (unknown_type_node) = unknown_type_node;
......
......@@ -1763,7 +1763,10 @@ args_as_string (p, v)
OB_INIT ();
for (; p; p = TREE_CHAIN (p))
{
dump_type (error_type (TREE_VALUE (p)), v);
if (TREE_VALUE (p) == null_node)
OB_PUTS ("NULL");
else
dump_type (error_type (TREE_VALUE (p)), v);
if (TREE_CHAIN (p))
OB_PUTS (", ");
}
......
......@@ -451,6 +451,10 @@ common_type (t1, t2)
target = tt1;
else if (tt1 == void_type_node || tt2 == void_type_node)
target = void_type_node;
else if (tt1 == unknown_type_node)
target = tt2;
else if (tt2 == unknown_type_node)
target = tt1;
else
target = common_type (tt1, tt2);
......@@ -871,7 +875,10 @@ comp_target_types (ttl, ttr, nptrs)
if (nptrs > 0)
{
if (TREE_CODE (ttl) == VOID_TYPE
if (TREE_CODE (ttl) == UNKNOWN_TYPE
|| TREE_CODE (ttr) == UNKNOWN_TYPE)
return 1;
else if (TREE_CODE (ttl) == VOID_TYPE
&& TREE_CODE (ttr) != FUNCTION_TYPE
&& TREE_CODE (ttr) != METHOD_TYPE
&& TREE_CODE (ttr) != OFFSET_TYPE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment