+2011-12-22 Jonathan Wakely <jwakely.gcc@gmail.com>
+
+ PR libstdc++/48362
+ * python/libstdcxx/v6/printers.py (StdTuplePrinter): Handle empty
+ tuples.
+
2011-12-20 Jonathan Wakely <jwakely.gcc@gmail.com>
PR libstdc++/51365
# Set the base class as the initial head of the
# tuple.
nodes = self.head.type.fields ()
- if len (nodes) != 1:
+ if len (nodes) == 1:
+ # Set the actual head to the first pair.
+ self.head = self.head.cast (nodes[0].type)
+ elif len (nodes) != 0:
raise ValueError, "Top of tuple tree does not consist of a single node."
-
- # Set the actual head to the first pair.
- self.head = self.head.cast (nodes[0].type)
self.count = 0
def __iter__ (self):
return self._iterator (self.val)
def to_string (self):
+ if len (self.val.type.fields ()) == 0:
+ return 'empty %s' % (self.typename)
return '%s containing' % (self.typename)
class StdStackOrQueuePrinter: