[libcxx-commits] [PATCH] D92255: [libc++] [P0202] constexpr set_union, set_difference, set_symmetric_difference, merge

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 3 12:50:56 PST 2020

zoecarver added a comment.

Thanks for all the test overhaul! Probably better done as a follow-up patch, but this format will make it easier to add move-only tests.

Comment at: libcxx/test/std/algorithms/alg.sorting/alg.merge/merge.pass.cpp:48
+    friend TEST_CONSTEXPR bool operator<(const NonTrivial& a, const NonTrivial& b) {
+        return a.value / 10 < b.value / 10;
+    }
Why do we divide this by 10? Let's make these tests as simple as possible. 

Nit: no friend, no pass-by-reference. 

Comment at: libcxx/test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp:9
-// Older compilers don't support std::is_constant_evaluated
-// UNSUPPORTED: clang-4, clang-5, clang-6, clang-7, clang-8
-// UNSUPPORTED: apple-clang-9, apple-clang-10
+// UNSUPPORTED: clang-8
What happened to all the other unsupported compilers? 

Comment at: libcxx/test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp:44
+struct NonTrivial {
+    int value;
Can we put these all into a header?

Comment at: libcxx/test/std/algorithms/alg.sorting/alg.merge/merge_comp.pass.cpp:61
+#if TEST_STD_VER >= 11
+static_assert(std::is_trivially_copyable<Trivial>::value, "");
+static_assert(!std::is_trivially_copyable<NonTrivial>::value, "");
I think these will work in C++03. 

  rG LLVM Github Monorepo



More information about the libcxx-commits mailing list