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
This commit is contained in:
Sterling Augustine 2020-07-13 17:19:01 -07:00
parent 0a90ffa772
commit 77ee4b4c9b
2 changed files with 6 additions and 2 deletions

View File

@ -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() {

View File

@ -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