From 449a432129c14002befb52eeabc0d9d6d4879a2f Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 6 Dec 2016 14:36:07 +0000 Subject: [PATCH] Fix pretty-printer for std::variant * python/libstdcxx/v6/printers.py (StdVariantPrinter): Update for new data member name. * testsuite/libstdc++-prettyprinters/cxx17.cc: Remove redundant test. From-SVN: r243304 --- libstdc++-v3/ChangeLog | 4 ++++ libstdc++-v3/python/libstdcxx/v6/printers.py | 2 +- libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc | 2 -- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 676d32b2722..56628091666 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,5 +1,9 @@ 2016-12-06 Jonathan Wakely + * python/libstdcxx/v6/printers.py (StdVariantPrinter): Update for new + data member name. + * testsuite/libstdc++-prettyprinters/cxx17.cc: Remove redundant test. + * include/bits/shared_ptr_base.h (__shared_ptr_access::operator->()): Fix assertion. diff --git a/libstdc++-v3/python/libstdcxx/v6/printers.py b/libstdc++-v3/python/libstdcxx/v6/printers.py index bad42b472a9..ff428e8f7e9 100644 --- a/libstdc++-v3/python/libstdcxx/v6/printers.py +++ b/libstdc++-v3/python/libstdcxx/v6/printers.py @@ -1002,7 +1002,7 @@ class StdVariantPrinter(SingleObjContainerPrinter): visualizer = None else: self.contained_type = alternatives[int(self.index)] - addr = val['_M_union']['_M_first']['_M_storage'].address + addr = val['_M_u']['_M_first']['_M_storage'].address contained_value = addr.cast(self.contained_type.pointer()).dereference() visualizer = gdb.default_visualizer(contained_value) super (StdVariantPrinter, self).__init__(contained_value, visualizer, 'array') diff --git a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc index 96be8c79235..69c16c10e91 100644 --- a/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc +++ b/libstdc++-v3/testsuite/libstdc++-prettyprinters/cxx17.cc @@ -86,8 +86,6 @@ main() // { dg-final { note-test v3 {std::variant [index 1] = {3}} } } variant v4{ str }; // { dg-final { note-test v4 {std::variant [index 2] = {"string"}} } } - variant vref{str}; -// { dg-final { note-test vref {std::variant [index 0] = {"string"}} } } map m{ {1, "one"} }; map::node_type n0; -- 2.30.2