mirror of
https://gcc.gnu.org/git/gcc.git
synced 2026-02-22 20:01:22 -05:00
This pretty printer was updated for GCC 16 to match a change to std::atomic<shared_ptr<T>>. But the gdb.Type.is_scalar property was added in GDB 12.1, so we get an error for older GDB versions. This adds a workaround for older GDB versions. The gdb.Type.tag property is None for scalar types, and should always be defined for the std::atomic class template. Another option would be to use the is_specialization_of function defined in printers.py, but just checking for the tag is simpler. libstdc++-v3/ChangeLog: * python/libstdcxx/v6/printers.py (SharedPointerPrinter): Only use gdb.Type.is_scalar if supported. * testsuite/libstdc++-prettyprinters/compat.cc: Test printer for old implementation of std::atomic<std::shared_ptr<T>>. Reviewed-by: Tomasz Kamiński <tkaminsk@redhat.com>