[Bug libstdc++/122812] pretty printing the map<> sometimes fails because of unexpected type specifiers

cvs-commit at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Dec 17 13:20:32 GMT 2025


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

--- Comment #5 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-15 branch has been updated by Jonathan Wakely
<redi@gcc.gnu.org>:

https://gcc.gnu.org/g:a4921df13f034bbd2c8a08bfff0a39b3fe7512e5

commit r15-10614-ga4921df13f034bbd2c8a08bfff0a39b3fe7512e5
Author: Vladimir Bespalov <vlad.bespalov@jetstreamsoft.com>
Date:   Sat Nov 22 19:58:08 2025 -0800

    libstdc++: Fix pretty printer lookup for class templates [PR122812]

    Under some circumstances the type.name of a pair<> type starts with
    "struct". This confuses GDB when we use gdb.lookup_type for the name of
    template specialization using "struct pair<...>" in its template
    argument list.

    Using type.tag avoids this problem.

    libstdc++-v3/ChangeLog:

            PR libstdc++/122812
            * python/libstdcxx/v6/printers.py (lookup_templ_spec): Use
            gdb.Type.tag if present.

    (cherry picked from commit dce0d564d742617f71297c88e4a1c0d6038f2c47)


More information about the Gcc-bugs mailing list