Adjust optional's pretty printer for LWG 2900.
authorVille Voutilainen <ville.voutilainen@gmail.com>
Wed, 29 Mar 2017 12:05:50 +0000 (15:05 +0300)
committerVille Voutilainen <ville@gcc.gnu.org>
Wed, 29 Mar 2017 12:05:50 +0000 (15:05 +0300)
* python/libstdcxx/v6/printers.py (StdExpOptionalPrinter.__init__):
Look at the nested payload in case of non-experimental optional.

From-SVN: r246566

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

index a4cb6b7..23ce6d3 100644 (file)
@@ -1,5 +1,11 @@
 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
        of optional are not constexpr.
        * include/std/optional (_Optional_payload): New.
index 14025dd..a67b27a 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'])