[Bug c++/88166] Inconsistent placement of cv-quals and ptr-declarator in debuginfo

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Nov 23 15:49:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88166

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Fri Nov 23 15:48:56 2018
New Revision: 266408

URL: https://gcc.gnu.org/viewcvs?rev=266408&root=gcc&view=rev
Log:
PR libstdc++/87308 adjust regex used in std::any pretty printer

The pretty printer for std::any fails when the contained value is a
locally-defined type, because the name in the debuginfo has
cv-qualifiers and ptr-declarators in different positions. The unexpected
format confuses the printer. This makes the printer's regex handle
either format.

This isn't a complete fix because looking up the contained type fails
when there are two types with the same name (defined in different local
scopes). This applies to all closure types defined in a given function,
as they all appear as "func()::lambda" in the debuginfo names.

        PR libstdc++/87308 (partial)
        * python/libstdcxx/v6/printers.py (StdExpAnyPrinter): Adjust regex to
        work around PR 88166.
        * testsuite/libstdc++-prettyprinters/cxx17.cc: Test std::any
        containing a local type.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/python/libstdcxx/v6/printers.py
    trunk/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc


More information about the Gcc-bugs mailing list