xref: /llvm-project/libcxx/test/std/strings/string.view/trivially_copyable.compile.pass.cpp (revision 4fc502368ad002e5b8deff87288eb0627f3e6bec)
170d7bef1SJoe Loser //===----------------------------------------------------------------------===//
270d7bef1SJoe Loser //
370d7bef1SJoe Loser // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
470d7bef1SJoe Loser // See https://llvm.org/LICENSE.txt for license information.
570d7bef1SJoe Loser // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
670d7bef1SJoe Loser //
770d7bef1SJoe Loser //===----------------------------------------------------------------------===//
870d7bef1SJoe Loser 
9*4fc50236SJoe Loser // UNSUPPORTED: !stdlib=libc++ && (c++03 || c++11 || c++14)
10*4fc50236SJoe Loser 
1170d7bef1SJoe Loser // P2251 was voted into C++23, but is supported even in C++17 mode by all vendors.
1270d7bef1SJoe Loser 
1370d7bef1SJoe Loser // <string_view>
1470d7bef1SJoe Loser 
1570d7bef1SJoe Loser #include <string_view>
1670d7bef1SJoe Loser #include <type_traits>
1770d7bef1SJoe Loser 
18f4c1258dSLouis Dionne #include "test_macros.h"
19f4c1258dSLouis Dionne 
2070d7bef1SJoe Loser static_assert(std::is_trivially_copyable<std::basic_string_view<char> >::value, "");
21f4c1258dSLouis Dionne #ifndef TEST_HAS_NO_WIDE_CHARACTERS
2270d7bef1SJoe Loser static_assert(std::is_trivially_copyable<std::basic_string_view<wchar_t> >::value, "");
23f4c1258dSLouis Dionne #endif
249027887eSMark de Wever #ifndef TEST_HAS_NO_CHAR8_T
2570d7bef1SJoe Loser static_assert(std::is_trivially_copyable<std::basic_string_view<char8_t> >::value, "");
2670d7bef1SJoe Loser #endif
2770d7bef1SJoe Loser static_assert(std::is_trivially_copyable<std::basic_string_view<char16_t> >::value, "");
2870d7bef1SJoe Loser static_assert(std::is_trivially_copyable<std::basic_string_view<char32_t> >::value, "");
29