re PR libstdc++/64695 (FAIL: libstdc++-prettyprinters/cxx11.cc)
PR libstdc++/64695 * python/libstdcxx/v6/printers.py (StdTuplePrinter): Handle new tuple layout. From-SVN: r220871
This commit is contained in:
parent
ab260a3e0c
commit
deaa1ccbec
|
@ -1,3 +1,9 @@
|
||||||
|
2015-02-20 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
|
PR libstdc++/64695
|
||||||
|
* python/libstdcxx/v6/printers.py (StdTuplePrinter): Handle new
|
||||||
|
tuple layout.
|
||||||
|
|
||||||
2015-02-19 Jonathan Wakely <jwakely@redhat.com>
|
2015-02-19 Jonathan Wakely <jwakely@redhat.com>
|
||||||
|
|
||||||
PR libstdc++/58357
|
PR libstdc++/58357
|
||||||
|
|
|
@ -327,22 +327,35 @@ class StdTuplePrinter:
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def __next__ (self):
|
def __next__ (self):
|
||||||
nodes = self.head.type.fields ()
|
|
||||||
# Check for further recursions in the inheritance tree.
|
# Check for further recursions in the inheritance tree.
|
||||||
|
# For a GCC 5+ tuple self.head is None after visiting all nodes:
|
||||||
|
if not self.head:
|
||||||
|
raise StopIteration
|
||||||
|
nodes = self.head.type.fields ()
|
||||||
|
# For a GCC 4.x tuple there is a final node with no fields:
|
||||||
if len (nodes) == 0:
|
if len (nodes) == 0:
|
||||||
raise StopIteration
|
raise StopIteration
|
||||||
# Check that this iteration has an expected structure.
|
# Check that this iteration has an expected structure.
|
||||||
if len (nodes) != 2:
|
if len (nodes) > 2:
|
||||||
raise ValueError("Cannot parse more than 2 nodes in a tuple tree.")
|
raise ValueError("Cannot parse more than 2 nodes in a tuple tree.")
|
||||||
|
|
||||||
# - Left node is the next recursion parent.
|
if len (nodes) == 1:
|
||||||
# - Right node is the actual class contained in the tuple.
|
# This is the last node of a GCC 5+ std::tuple.
|
||||||
|
impl = self.head.cast (nodes[0].type)
|
||||||
|
self.head = None
|
||||||
|
else:
|
||||||
|
# Either a node before the last node, or the last node of
|
||||||
|
# a GCC 4.x tuple (which has an empty parent).
|
||||||
|
|
||||||
# Process right node.
|
# - Left node is the next recursion parent.
|
||||||
impl = self.head.cast (nodes[1].type)
|
# - Right node is the actual class contained in the tuple.
|
||||||
|
|
||||||
|
# Process right node.
|
||||||
|
impl = self.head.cast (nodes[1].type)
|
||||||
|
|
||||||
|
# Process left node and set it as head.
|
||||||
|
self.head = self.head.cast (nodes[0].type)
|
||||||
|
|
||||||
# Process left node and set it as head.
|
|
||||||
self.head = self.head.cast (nodes[0].type)
|
|
||||||
self.count = self.count + 1
|
self.count = self.count + 1
|
||||||
|
|
||||||
# Finally, check the implementation. If it is
|
# Finally, check the implementation. If it is
|
||||||
|
|
Loading…
Reference in New Issue