This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] libstdc++: Fix libstdc++/67440: pretty-printing of a const set<foo> fails
- From: Jonathan Wakely <jwakely at redhat dot com>
- To: Doug Evans <dje at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- Date: Mon, 16 Nov 2015 21:24:48 +0000
- Subject: Re: [PATCH] libstdc++: Fix libstdc++/67440: pretty-printing of a const set<foo> fails
- Authentication-results: sourceware.org; auth=none
- References: <047d7b10cdcf8731080524aec2e9 at google dot com>
On 16/11/15 21:04 +0000, Doug Evans wrote:
Hi.
Apologies for the delay.
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67440
Tested with current trunk.
2015-11-16 Doug Evans <dje@google.com>
PR libstdc++/67440
* python/libstdcxx/v6/printers.py (find_type): Handle "const" in
type name.
* testsuite/libstdc++-prettyprinters/debug.cc: Add test for
const set<int>.
* testsuite/libstdc++-prettyprinters/simple.cc: Ditto.
* testsuite/libstdc++-prettyprinters/simple11.cc: Ditto.
Index: python/libstdcxx/v6/printers.py
===================================================================
--- python/libstdcxx/v6/printers.py (revision 227421)
+++ python/libstdcxx/v6/printers.py (working copy)
@@ -85,7 +85,9 @@
def find_type(orig, name):
typ = orig.strip_typedefs()
while True:
- search = str(typ) + '::' + name
+ # Use typ.name here instead of str(typ) to discard any const,etc.
+ # qualifiers. PR 67440.
+ search = typ.name + '::' + name
Oh, that's surprisingly simple! :-)
This only affects the printers, so although we're in stage 3 this is
OK for trunk and gcc-5-branch, thanks.