mirror of git://gcc.gnu.org/git/gcc.git
PR libstdc++/65229 fix pretty printer for std::bitset<0>
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>. Co-Authored-By: Jonathan Wakely <jwakely@redhat.com> From-SVN: r266409
This commit is contained in:
parent
11aa881f98
commit
14a9206d0c
|
|
@ -1,3 +1,11 @@
|
|||
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)
|
||||
|
|
|
|||
|
|
@ -702,7 +702,13 @@ class StdBitsetPrinter:
|
|||
return '%s' % (self.typename)
|
||||
|
||||
def children (self):
|
||||
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
|
||||
|
|
@ -952,7 +958,6 @@ class Tr1UnorderedMapPrinter:
|
|||
# Zip the two iterators together.
|
||||
return izip (counter, data)
|
||||
|
||||
|
||||
def display_hint (self):
|
||||
return 'map'
|
||||
|
||||
|
|
|
|||
|
|
@ -41,6 +41,10 @@ main()
|
|||
std::string str = "zardoz";
|
||||
// { dg-final { note-test str "\"zardoz\"" } }
|
||||
|
||||
// PR 65229
|
||||
std::bitset<0> bs0;
|
||||
// { dg-final { note-test bs0 {std::bitset} } }
|
||||
|
||||
std::bitset<10> bs;
|
||||
bs[0] = 1;
|
||||
bs[5] = 1;
|
||||
|
|
|
|||
Loading…
Reference in New Issue