From 3df095e2f1c04a8674ff250747aa591a5e26a861 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Sun, 19 Jul 1998 17:54:13 +0000 Subject: [PATCH] error.c (dump_type_real): Don't crash when presented with intQI_type_node or the like. * error.c (dump_type_real): Don't crash when presented with intQI_type_node or the like. From-SVN: r21284 --- gcc/cp/ChangeLog | 3 +++ gcc/cp/error.c | 14 ++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a4e5eeccc37..51cac5f1511 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 1998-07-19 Mark Mitchell + * 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. diff --git a/gcc/cp/error.c b/gcc/cp/error.c index d4dc054c970..bb21bcb5021 100644 --- a/gcc/cp/error.c +++ b/gcc/cp/error.c @@ -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: