diff options
author | Mark Mitchell <mark@markmitchell.com> | 1998-07-19 17:54:13 +0000 |
---|---|---|
committer | Mark Mitchell <mmitchel@gcc.gnu.org> | 1998-07-19 17:54:13 +0000 |
commit | 3df095e2f1c04a8674ff250747aa591a5e26a861 (patch) | |
tree | 5b675f568b83843782caafb9df782602894ead4c /gcc | |
parent | 8014a339af55eddc9551cde047d57a28b76ffd4f (diff) | |
download | gcc-3df095e2f1c04a8674ff250747aa591a5e26a861.zip gcc-3df095e2f1c04a8674ff250747aa591a5e26a861.tar.gz gcc-3df095e2f1c04a8674ff250747aa591a5e26a861.tar.bz2 |
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
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/error.c | 14 |
2 files changed, 15 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a4e5eec..51cac5f 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -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. diff --git a/gcc/cp/error.c b/gcc/cp/error.c index d4dc054..bb21bcb 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: |