From: Jim Blandy Date: Tue, 24 Apr 2001 23:12:50 +0000 (+0000) Subject: * c-typeprint.c (c_type_print_cv_qualifier): Don't print `const' X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7f0b5c30f8ce2f5fef01fe76a34d6487c129f565;p=binutils-gdb.git * c-typeprint.c (c_type_print_cv_qualifier): Don't print `const' qualifier on C++ references; all references are innately const. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6c2cfd41570..b3b1068b822 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2001-04-24 Jim Blandy + + * c-typeprint.c (c_type_print_cv_qualifier): Don't print `const' + qualifier on C++ references; all references are innately const. + 2001-04-20 Mark Kettenis * event-top.h: Fix formatting. diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index 814c2d3310b..ab9abc70c0c 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, " ");