From 5d221ff0219d8d019b2dfad285da35c60f4919a0 Mon Sep 17 00:00:00 2001 From: morzhovets Date: Sun, 26 Nov 2023 20:57:53 +0400 Subject: [PATCH] Update libcxx/map --- test/sources/LibcxxMapTests.h | 40 ++++++++++--------- .../libcxx/map/map.access/max_size.pass.cpp | 2 +- .../libcxx/map/map.cons/deduct.pass.cpp | 6 ++- .../map.cons/move_assign_noexcept.pass.cpp | 2 + .../map/map.cons/move_noexcept.pass.cpp | 2 + 5 files changed, 32 insertions(+), 20 deletions(-) diff --git a/test/sources/LibcxxMapTests.h b/test/sources/LibcxxMapTests.h index c2052b13..a69bbdb0 100644 --- a/test/sources/LibcxxMapTests.h +++ b/test/sources/LibcxxMapTests.h @@ -96,25 +96,29 @@ LIBCXX_TEST_BEGIN(cons_deduct) #include "libcxx/map/map.cons/deduct.pass.cpp" LIBCXX_TEST_END -//LIBCXX_TEST_BEGIN(cons_deduct_const) -//#include "libcxx/map/map.cons/deduct_const.pass.cpp" -//LIBCXX_TEST_END +#ifdef LIBCPP_HAS_BAD_NEWS_FOR_MOMO +LIBCXX_TEST_BEGIN(cons_deduct_const) +#include "libcxx/map/map.cons/deduct_const.pass.cpp" +LIBCXX_TEST_END +#endif LIBCXX_TEST_BEGIN(cons_default) #include "libcxx/map/map.cons/default.pass.cpp" LIBCXX_TEST_END -//LIBCXX_TEST_BEGIN(cons_default_noexcept) -//#include "libcxx/map/map.cons/default_noexcept.pass.cpp" -//LIBCXX_TEST_END +LIBCXX_TEST_BEGIN(cons_default_noexcept) +#include "libcxx/map/map.cons/default_noexcept.pass.cpp" +LIBCXX_TEST_END -//LIBCXX_TEST_BEGIN(cons_default_recursive) -//#include "libcxx/map/map.cons/default_recursive.pass.cpp" -//LIBCXX_TEST_END +#ifdef LIBCPP_HAS_BAD_NEWS_FOR_MOMO +LIBCXX_TEST_BEGIN(cons_default_recursive) +#include "libcxx/map/map.cons/default_recursive.pass.cpp" +LIBCXX_TEST_END +#endif -//LIBCXX_TEST_BEGIN(cons_dtor_noexcept) -//#include "libcxx/map/map.cons/dtor_noexcept.pass.cpp" -//LIBCXX_TEST_END +LIBCXX_TEST_BEGIN(cons_dtor_noexcept) +#include "libcxx/map/map.cons/dtor_noexcept.pass.cpp" +LIBCXX_TEST_END LIBCXX_TEST_BEGIN(cons_initializer_list) #include "libcxx/map/map.cons/initializer_list.pass.cpp" @@ -152,13 +156,13 @@ LIBCXX_TEST_BEGIN(cons_move_assign) #include "libcxx/map/map.cons/move_assign.pass.cpp" LIBCXX_TEST_END -//LIBCXX_TEST_BEGIN(cons_move_assign_noexcept) -//#include "libcxx/map/map.cons/move_assign_noexcept.pass.cpp" -//LIBCXX_TEST_END +LIBCXX_TEST_BEGIN(cons_move_assign_noexcept) +#include "libcxx/map/map.cons/move_assign_noexcept.pass.cpp" +LIBCXX_TEST_END -//LIBCXX_TEST_BEGIN(cons_move_noexcept) -//#include "libcxx/map/map.cons/move_noexcept.pass.cpp" -//LIBCXX_TEST_END +LIBCXX_TEST_BEGIN(cons_move_noexcept) +#include "libcxx/map/map.cons/move_noexcept.pass.cpp" +LIBCXX_TEST_END LIBCXX_TEST_BEGIN(erasure_erase_if) #include "libcxx/map/map.erasure/erase_if.pass.cpp" diff --git a/test/sources/libcxx/map/map.access/max_size.pass.cpp b/test/sources/libcxx/map/map.access/max_size.pass.cpp index 1deb187f..17e0cca4 100644 --- a/test/sources/libcxx/map/map.access/max_size.pass.cpp +++ b/test/sources/libcxx/map/map.access/max_size.pass.cpp @@ -27,7 +27,7 @@ int main(int, char**) LIBCPP_ASSERT(c.max_size() == 10); } { - typedef limited_allocator A; + typedef limited_allocator(-1)> A; typedef std::map, A> C; const C::size_type max_dist = static_cast(std::numeric_limits::max()); diff --git a/test/sources/libcxx/map/map.cons/deduct.pass.cpp b/test/sources/libcxx/map/map.cons/deduct.pass.cpp index b473149d..90714f8a 100644 --- a/test/sources/libcxx/map/map.cons/deduct.pass.cpp +++ b/test/sources/libcxx/map/map.cons/deduct.pass.cpp @@ -133,10 +133,12 @@ int main(int, char**) { // Examples from LWG3025 +#if !defined(TEST_GCC) momo::stdish::map m{std::pair{1, 1}, {2, 2}, {3, 3}}; ASSERT_SAME_TYPE(decltype(m), momo::stdish::map); +#endif -#if !defined(TEST_MSVC) +#if !defined(TEST_MSVC) && !defined(TEST_CLANG) momo::stdish::map m2{m.begin(), m.end()}; ASSERT_SAME_TYPE(decltype(m2), momo::stdish::map); #endif @@ -147,9 +149,11 @@ int main(int, char**) momo::stdish::map m1{{std::pair{1, 2}, {3, 4}}, std::less()}; ASSERT_SAME_TYPE(decltype(m1), momo::stdish::map); +#if !defined(TEST_GCC) && !defined(TEST_CLANG) using value_type = std::pair; momo::stdish::map m2{{value_type{1, 2}, {3, 4}}, std::less()}; ASSERT_SAME_TYPE(decltype(m2), momo::stdish::map); +#endif } AssociativeContainerDeductionGuidesSfinaeAway>(); diff --git a/test/sources/libcxx/map/map.cons/move_assign_noexcept.pass.cpp b/test/sources/libcxx/map/map.cons/move_assign_noexcept.pass.cpp index fa2092dd..8085e3ec 100644 --- a/test/sources/libcxx/map/map.cons/move_assign_noexcept.pass.cpp +++ b/test/sources/libcxx/map/map.cons/move_assign_noexcept.pass.cpp @@ -47,10 +47,12 @@ int main(int, char**) static_assert(std::is_nothrow_move_assignable::value, ""); } #endif // _LIBCPP_VERSION +#ifdef LIBCPP_HAS_BAD_NEWS_FOR_MOMO { typedef std::map> C; static_assert(!std::is_nothrow_move_assignable::value, ""); } +#endif return 0; } diff --git a/test/sources/libcxx/map/map.cons/move_noexcept.pass.cpp b/test/sources/libcxx/map/map.cons/move_noexcept.pass.cpp index 54ec889d..2d30fa4d 100644 --- a/test/sources/libcxx/map/map.cons/move_noexcept.pass.cpp +++ b/test/sources/libcxx/map/map.cons/move_noexcept.pass.cpp @@ -45,10 +45,12 @@ int main(int, char**) static_assert(std::is_nothrow_move_constructible::value, ""); } #endif // _LIBCPP_VERSION +#ifdef LIBCPP_HAS_BAD_NEWS_FOR_MOMO { typedef std::map> C; static_assert(!std::is_nothrow_move_constructible::value, ""); } +#endif return 0; }