error.c (dump_type_real): Don't crash when presented with intQI_type_node or the...
authorMark Mitchell <mark@markmitchell.com>
Sun, 19 Jul 1998 17:54:13 +0000 (17:54 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Sun, 19 Jul 1998 17:54:13 +0000 (17:54 +0000)
* error.c (dump_type_real): Don't crash when presented with
intQI_type_node or the like.

From-SVN: r21284

gcc/cp/ChangeLog
gcc/cp/error.c

index a4e5eeccc37be288e709f31afaff783ebdacdffc..51cac5f15115b2f3a8e999c6fa6d21c9e322232c 100644 (file)
@@ -1,5 +1,8 @@
 1998-07-19  Mark Mitchell  <mark@markmitchell.com>
 
+       * error.c (dump_type_real): Don't crash when presented with
+       intQI_type_node or the like.
+
        * semantics.c (finish_translation_unit): Fix spelling error in
        comment.
 
index d4dc054c970c8acee55c6393bac223bcd484966a..bb21bcb5021c7420761af2e21d708490f76c10ce 100644 (file)
@@ -229,8 +229,18 @@ dump_type_real (t, v, canonical_name)
     case REAL_TYPE:
     case VOID_TYPE:
     case BOOLEAN_TYPE:
-      dump_readonly_or_volatile (t, after);
-      OB_PUTID (TYPE_IDENTIFIER (canonical_name ? TYPE_MAIN_VARIANT (t) : t));
+      {
+       tree type;
+       dump_readonly_or_volatile (t, after);
+       type = canonical_name ? TYPE_MAIN_VARIANT (t) : t;
+       if (TYPE_NAME (type) && TYPE_IDENTIFIER (type))
+         OB_PUTID (TYPE_IDENTIFIER (type));
+       else
+         /* Types like intQI_type_node and friends have no names.
+            These don't come up in user error messages, but it's nice
+            to be able to print them from the debugger.  */
+         OB_PUTS ("{anonymous}");
+      }
       break;
 
     case TEMPLATE_TEMPLATE_PARM: