aboutsummaryrefslogtreecommitdiff
path: root/gdb/c-typeprint.c
diff options
context:
space:
mode:
authorJim Blandy <jimb@codesourcery.com>2001-04-24 23:12:50 +0000
committerJim Blandy <jimb@codesourcery.com>2001-04-24 23:12:50 +0000
commit7f0b5c30f8ce2f5fef01fe76a34d6487c129f565 (patch)
treeb875c529c7c6d3b63e915493bd13e12a78fcf9d7 /gdb/c-typeprint.c
parent7674a3df3747389386d869febeda2e235fbf046b (diff)
downloadgdb-7f0b5c30f8ce2f5fef01fe76a34d6487c129f565.zip
gdb-7f0b5c30f8ce2f5fef01fe76a34d6487c129f565.tar.gz
gdb-7f0b5c30f8ce2f5fef01fe76a34d6487c129f565.tar.bz2
* c-typeprint.c (c_type_print_cv_qualifier): Don't print `const'
qualifier on C++ references; all references are innately const.
Diffstat (limited to 'gdb/c-typeprint.c')
-rw-r--r--gdb/c-typeprint.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c
index 814c2d3..ab9abc7 100644
--- a/gdb/c-typeprint.c
+++ b/gdb/c-typeprint.c
@@ -293,7 +293,11 @@ c_type_print_cv_qualifier (struct type *type, struct ui_file *stream,
{
int flag = 0;
- if (TYPE_CONST (type))
+ /* We don't print `const' qualifiers for references --- since all
+ operators affect the thing referenced, not the reference itself,
+ every reference is `const'. */
+ if (TYPE_CONST (type)
+ && TYPE_CODE (type) != TYPE_CODE_REF)
{
if (need_pre_space)
fprintf_filtered (stream, " ");