Commit 77ee4b4c authored by Sterling Augustine's avatar Sterling Augustine
Browse files

Desugar class type for iterator lookup.

Summary:
Without this, printing sets and maps hidden behind
using declarations fail.

Reviewers: #libc!

Subscribers: libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D83732
parent 0a90ffa7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -383,6 +383,10 @@ void set_test() {
  ComparePrettyPrintToChars(prime_pairs,
      "std::set with 2 elements = {"
      "{first = 3, second = 5}, {first = 5, second = 7}}");

  using using_set = std::set<int>;
  using_set other{1, 2, 3};
  ComparePrettyPrintToChars(other, "std::set with 3 elements = {1, 2, 3}");
}

void stack_test() {
+2 −2
Original line number Diff line number Diff line
@@ -698,7 +698,7 @@ class StdMapPrinter(AbstractRBTreePrinter):

    def _init_cast_type(self, val_type):
        map_it_type = gdb.lookup_type(
            str(val_type) + "::iterator").strip_typedefs()
            str(val_type.strip_typedefs()) + "::iterator").strip_typedefs()
        tree_it_type = map_it_type.template_argument(0)
        node_ptr_type = tree_it_type.template_argument(1)
        return node_ptr_type
@@ -717,7 +717,7 @@ class StdSetPrinter(AbstractRBTreePrinter):

    def _init_cast_type(self, val_type):
        set_it_type = gdb.lookup_type(
            str(val_type) + "::iterator").strip_typedefs()
            str(val_type.strip_typedefs()) + "::iterator").strip_typedefs()
        node_ptr_type = set_it_type.template_argument(1)
        return node_ptr_type