This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
RFA: don't print `const' qualifier for ref types
- To: gdb-patches at sources dot redhat dot com
- Subject: RFA: don't print `const' qualifier for ref types
- From: Jim Blandy <jimb at zwingli dot cygnus dot com>
- Date: Tue, 24 Apr 2001 12:47:35 -0500 (EST)
See the comments in the patched code for details.
2001-04-13 Jim Blandy <jimb@redhat.com>
* c-typeprint.c (c_type_print_cv_qualifier): Don't print `const'
qualifier on C++ references; all references are innately const.
Index: gdb/c-typeprint.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/c-typeprint.c,v
retrieving revision 2.45.30.2
diff -c -r2.45.30.2 c-typeprint.c
*** gdb/c-typeprint.c 2001/03/26 18:23:19 2.45.30.2
--- gdb/c-typeprint.c 2001/04/14 08:21:03
***************
*** 296,302 ****
{
int flag = 0;
! if (TYPE_CONST (type))
{
if (need_pre_space)
fprintf_filtered (stream, " ");
--- 296,306 ----
{
int flag = 0;
! /* 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, " ");