[libcxx-commits] [PATCH] D111197: [libc++] Verify span and string_view are trivially copyable

Joe Loser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Oct 7 09:01:23 PDT 2021


jloser marked 4 inline comments as done.
jloser added inline comments.


================
Comment at: libcxx/test/std/strings/string.view/trivially_copyable.compile.pass.cpp:20
+static_assert(std::is_trivially_copyable<std::basic_string_view<wchar_t> >::value, "");
+#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
+static_assert(std::is_trivially_copyable<std::basic_string_view<char8_t> >::value, "");
----------------
Mordante wrote:
> Quuxplusone wrote:
> > `#ifndef _LIBCPP_HAS_NO_CHAR8_T` plz
> Actually I think we can remove the `#ifdef` since we only support compilers providing `char8_t`. In D110868 I've started to make the support unconditional, but that was put on hold due to the Buildkite issues. (For now I'll wait until the @ldionne's `wchar_t` changes have landed.) If you want to add an `#ifdef` please use @Quuxplusone's suggestion.
The issue is that clang only supports `char8_t` itself in C++20 or later, but this test is run in C++03 or later, so the `#ifdef` is needed. Switched to using `#ifndef _LIBCPP_HAS_NO_CHAR8_T`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D111197/new/

https://reviews.llvm.org/D111197



More information about the libcxx-commits mailing list