]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Fix unique_ptr pretty printer for empty classes
authorJonathan Wakely <jwakely@redhat.com>
Tue, 14 May 2019 11:17:18 +0000 (12:17 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Mon, 11 Jan 2021 11:20:11 +0000 (11:20 +0000)
commit94a665fcc68c4b48f5ad8acae7e1a49868c94026
tree5565662c38e0499a6afb543fb232232341e46c5e
parentaf0dd3ec61165bbff7843d34d3ec8bdf7cabbfbe
libstdc++: Fix unique_ptr pretty printer for empty classes

The printer was confused when unique_ptr<T,D>::pointer is an empty
class, or the deleter is not empty. Instead of assuming the tuple has a
single _M_head_impl member manually inspect the tuple base classes to
get the first element.

* python/libstdcxx/v6/printers.py (UniquePointerPrinter.__init__): Do
not assume field called _M_head_impl is the first tuple element.
* testsuite/libstdc++-prettyprinters/compat.cc: Make tuple
implementation more accurate.
* testsuite/libstdc++-prettyprinters/cxx11.cc: Check unique_ptr with
empty pointer type and non-empty deleter.

(cherry picked from commit e25f488d603a6bd7570c1ffdfd9572e4b8a645de)
libstdc++-v3/python/libstdcxx/v6/printers.py
libstdc++-v3/testsuite/libstdc++-prettyprinters/compat.cc
libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx11.cc
This page took 0.064945 seconds and 5 git commands to generate.