[PATCH] libstdc++: Fix libstdc++/67440: pretty-printing of a const set<foo> fails
Jonathan Wakely
jwakely@redhat.com
Mon Nov 16 21:24:00 GMT 2015
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.
More information about the Libstdc++
mailing list