RFA: don't print `const' qualifier for ref types
Jim Blandy
jimb@zwingli.cygnus.com
Tue Apr 24 10:46:00 GMT 2001
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, " ");
More information about the Gdb-patches
mailing list