OSDN Git Service

* decl.c (init_decl_processing): Give null_node unknown* type.
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 20 Oct 1997 18:09:06 +0000 (18:09 +0000)
committerjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 20 Oct 1997 18:09:06 +0000 (18:09 +0000)
* typeck.c (comp_target_types): Handle UNKNOWN_TYPE.
(common_type): Likewise.
* error.c (args_as_string): Recognize null_node.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@16100 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/error.c
gcc/cp/typeck.c

index 0049abf..c303489 100644 (file)
@@ -1,3 +1,10 @@
+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"
index 6f1007c..59fdbb3 100644 (file)
@@ -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;
 
index bec7bfa..5128175 100644 (file)
@@ -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 (", ");
     }
index d5d4381..aafea54 100644 (file)
@@ -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)