[libcxx-commits] [PATCH] D74350: [libcxx][type_traits] Add C++20 changes to common_type
Michael Schellenberger Costa via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Thu May 14 13:03:51 PDT 2020
miscco marked 2 inline comments as done.
miscco added inline comments.
================
Comment at: libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp:228
+// -- Otherwise, if COND-RES(CREF(D1), CREF(D2)) denotes a type, let C
+// denote the type decay_t<COND-RES(CREF(D1), CREF(D2))>.
+void test_bullet_three_four() {
----------------
ldionne wrote:
> There's a weird non-printable character on this line (`<U+00AD>`). I noticed that by looking at the diff in `git`. Please watch out for those.
Sory, I guess this comes from copying from eel.is I will have a look for those
================
Comment at: libcxx/test/std/utilities/meta/meta.trans/meta.trans.other/common_type.pass.cpp:231
+#if TEST_STD_VER >= 20
+ static_assert(std::is_same_v<std::common_type_t<int, bad_reference_wrapper<int>>, int>, "");
+ static_assert(std::is_same_v<std::common_type_t<bad_reference_wrapper<double>, double>, double>, "");
----------------
ldionne wrote:
> Don't we need to test with some cv qualified and ref types too?
I guess adding cv qualifiers similar to the above bullets should work even for a reference wrapper.
If I understand [[ http://eel.is/c++draft/meta#trans.other-3.1 | CREF]] correctly this should also work `std::is_same_v<std::common_type_t<bad_reference_wrapper<double>&, double>, double>`
I will come back with some additional tests
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D74350/new/
https://reviews.llvm.org/D74350
More information about the libcxx-commits
mailing list