Skip to content

Commit b443799

Browse files
committed
[libc++][test] Disable test for extension that's unsupportable in C++20
Defining the nested types `reference` and `iterator_concept` of `reverse_iterator<I>` necessarily requires `I` to be complete in C++20. These tests that verify that `std::map<int, X>::reverse_iterator` can be instantiated when `X` is incomplete are going to have a bad time. Differential Revision: https://reviews.llvm.org/D78944
1 parent a90151d commit b443799

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

libcxx/test/std/containers/associative/map/map.cons/default_recursive.pass.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ struct X
2121
std::map<int, X> m;
2222
std::map<int, X>::iterator i;
2323
std::map<int, X>::const_iterator ci;
24+
#if TEST_STD_VER <= 17
25+
// These reverse_iterator specializations require X to be complete in C++20.
2426
std::map<int, X>::reverse_iterator ri;
2527
std::map<int, X>::const_reverse_iterator cri;
28+
#endif // TEST_STD_VER <= 17
2629
};
2730

28-
int main(int, char**)
29-
{
30-
31-
return 0;
32-
}
31+
int main(int, char**) { return 0; }

libcxx/test/std/containers/associative/multimap/multimap.cons/default_recursive.pass.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,11 @@ struct X
2121
std::multimap<int, X> m;
2222
std::multimap<int, X>::iterator i;
2323
std::multimap<int, X>::const_iterator ci;
24+
#if TEST_STD_VER <= 17
25+
// These reverse_iterator specializations require X to be complete in C++20.
2426
std::multimap<int, X>::reverse_iterator ri;
2527
std::multimap<int, X>::const_reverse_iterator cri;
28+
#endif // TEST_STD_VER <= 17
2629
};
2730

28-
int main(int, char**)
29-
{
30-
31-
return 0;
32-
}
31+
int main(int, char**) { return 0; }

0 commit comments

Comments
 (0)