libstdc++: Declutter std::optional and std:variant pretty printers [PR110944]
commit701ce3c723623af13597c05df09a049c57c52fc0
authorJonathan Wakely <jwakely@redhat.com>
Tue, 22 Aug 2023 13:26:51 +0000 (22 14:26 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Thu, 24 Aug 2023 12:40:24 +0000 (24 13:40 +0100)
treef5d93829a52630088e252da03605bf7d2799613f
parenta6303a09f946837927a6581d1b1c38e162b0aa1b
libstdc++: Declutter std::optional and std:variant pretty printers [PR110944]

As the PR says, including the template arguments in the GDB output of
these class templates can result in very long names, especially for
std::variant. You can use 'whatis' or other GDB commands to get details
of the type, we don't need to include it in the value.

We could consider including the type if it's not too long, but I think
consistency is better (and we already omit the template arguments for
std::vector and other class templates).

libstdc++-v3/ChangeLog:

PR libstdc++/110944
* python/libstdcxx/v6/printers.py (StdExpOptionalPrinter): Do
not show template arguments.
(StdVariantPrinter): Likewise.
* testsuite/libstdc++-prettyprinters/compat.cc: Adjust expected
output.
* testsuite/libstdc++-prettyprinters/cxx17.cc: Likewise.
* testsuite/libstdc++-prettyprinters/libfundts.cc: Likewise.
libstdc++-v3/python/libstdcxx/v6/printers.py
libstdc++-v3/testsuite/libstdc++-prettyprinters/compat.cc
libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc
libstdc++-v3/testsuite/libstdc++-prettyprinters/libfundts.cc