]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Adjust optional's pretty printer for LWG 2900.
authorville <ville@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Mar 2017 12:05:50 +0000 (12:05 +0000)
committerville <ville@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 29 Mar 2017 12:05:50 +0000 (12:05 +0000)
* python/libstdcxx/v6/printers.py (StdExpOptionalPrinter.__init__):
Look at the nested payload in case of non-experimental optional.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@246566 138bc75d-0d04-0410-961f-82ee72b054a4

libstdc++-v3/ChangeLog
libstdc++-v3/python/libstdcxx/v6/printers.py

index a4cb6b7d6cf42bfc892947dabb623536b2cbd3aa..23ce6d3885b723e8a0836ca8c11a4378e3bcf5ec 100644 (file)
@@ -1,3 +1,9 @@
+2017-03-29  Ville Voutilainen  <ville.voutilainen@gmail.com>
+
+       Adjust optional's pretty printer for LWG 2900.
+       * python/libstdcxx/v6/printers.py (StdExpOptionalPrinter.__init__):
+       Look at the nested payload in case of non-experimental optional.
+
 2017-03-29  Ville Voutilainen  <ville.voutilainen@gmail.com>
 
        Implement LWG 2900, The copy and move constructors
index 14025dda2a1b76782a1d5de4a12f7cb0852d73b8..a67b27ab736879044bd814e20222bdf9ba014901 100644 (file)
@@ -1023,6 +1023,8 @@ class StdExpOptionalPrinter(SingleObjContainerPrinter):
         valtype = self._recognize (val.type.template_argument(0))
         self.typename = re.sub('^std::(experimental::|)(fundamentals_v\d::|)(.*)', r'std::\1\3<%s>' % valtype, typename, 1)
         self.typename = strip_versioned_namespace(self.typename)
+        if not self.typename.startswith('std::experimental'):
+            val = val['_M_payload']
         self.val = val
         contained_value = val['_M_payload'] if self.val['_M_engaged'] else None
         visualizer = gdb.default_visualizer (val['_M_payload'])