+2018-11-23 Martin Sebor <msebor@redhat.com>
+ Jonathan Wakely <jwakely@redhat.com>
+
+ PR libstdc++/65229
+ * python/libstdcxx/v6/printers.py (StdBitsetPrinter): Handle
+ exception thrown for std::bitset<0>.
+ * testsuite/libstdc++-prettyprinters/simple.cc: Test std::bitset<0>.
+
2018-11-23 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/87308 (partial)
return '%s' % (self.typename)
def children (self):
- words = self.val['_M_w']
+ try:
+ # An empty bitset may not have any members which will
+ # result in an exception being thrown.
+ words = self.val['_M_w']
+ except:
+ return []
+
wtype = words.type
# The _M_w member can be either an unsigned long, or an
tsize = wtype.target ().sizeof
else:
words = [words]
- tsize = wtype.sizeof
+ tsize = wtype.sizeof
nwords = wtype.sizeof / tsize
result = []
self.node = self.buckets[self.bucket]
if self.node:
break
- self.bucket = self.bucket + 1
+ self.bucket = self.bucket + 1
def __iter__ (self):
return self
data = self.flatten (imap (self.format_one, StdHashtableIterator (self.hashtable())))
# Zip the two iterators together.
return izip (counter, data)
-
def display_hint (self):
return 'map'