2
0
mirror of git://gcc.gnu.org/git/gcc.git synced 2025-04-13 15:01:21 +08:00

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.

From-SVN: r246566
This commit is contained in:
Ville Voutilainen 2017-03-29 15:05:50 +03:00 committed by Ville Voutilainen
parent 5c0a28d4c5
commit 0000fd8cfd
2 changed files with 8 additions and 0 deletions
libstdc++-v3
ChangeLog
python/libstdcxx/v6

@ -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

@ -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'])