[libc++][test] Disable test for extension that's unsupportable in C++20
authorCasey Carter <cacarter@microsoft.com>
Mon, 27 Apr 2020 16:55:00 +0000 (09:55 -0700)
committerCasey Carter <Casey@Carter.net>
Mon, 27 Apr 2020 20:06:31 +0000 (13:06 -0700)
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

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

index 610ca10..8b95aef 100644 (file)
@@ -21,12 +21,11 @@ struct X
     std::map<int, X> m;
     std::map<int, X>::iterator i;
     std::map<int, X>::const_iterator ci;
+#if TEST_STD_VER <= 17
+    // These reverse_iterator specializations require X to be complete in C++20.
     std::map<int, X>::reverse_iterator ri;
     std::map<int, X>::const_reverse_iterator cri;
+#endif // TEST_STD_VER <= 17
 };
 
-int main(int, char**)
-{
-
-  return 0;
-}
+int main(int, char**) { return 0; }
index e468ebf..94003f3 100644 (file)
@@ -21,12 +21,11 @@ struct X
     std::multimap<int, X> m;
     std::multimap<int, X>::iterator i;
     std::multimap<int, X>::const_iterator ci;
+#if TEST_STD_VER <= 17
+    // These reverse_iterator specializations require X to be complete in C++20.
     std::multimap<int, X>::reverse_iterator ri;
     std::multimap<int, X>::const_reverse_iterator cri;
+#endif // TEST_STD_VER <= 17
 };
 
-int main(int, char**)
-{
-
-  return 0;
-}
+int main(int, char**) { return 0; }