[PR55641] drop spurious const_type from reference_type variables
commit1289a281c150d8a88226bfbf99eca43420dbbd76
authoraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 12 Aug 2016 07:11:36 +0000 (12 07:11 +0000)
committeraoliva <aoliva@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 12 Aug 2016 07:11:36 +0000 (12 07:11 +0000)
tree4cbe33f6735cc7602988194ca2515c67d921361d
parent9a478fab453a7cb0435a065d389983a90f894e8b
[PR55641] drop spurious const_type from reference_type variables

Although C++ reference types, denoted by DW_TAG_reference_type in
DWARFv2+ debug info, are unchangeable, we output names of reference type
with DW_TAG_const_type, because internally we mark such variables as
TREE_READONLY.  That's an internal implementation detail that shouldn't
leak to debug information.  This patch fixes this.

for  gcc/ChangeLog

PR debug/55641
* dwarf2out.c (decl_quals): Don't map TREE_READONLY to
TYPE_QUAL_CONST in reference-typed decls.

for  gcc/testsuite/ChangeLog

PR debug/55641
* g++.dg/debug/dwarf2/ref-1.C: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@239402 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/dwarf2out.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/debug/dwarf2/ref-1.C [new file with mode: 0644]