| 1 |
//===----------------------------------------------------------------------===// |
| 2 |
// |
| 3 |
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 |
// See https://llvm.org/LICENSE.txt for license information. |
| 5 |
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 |
// |
| 7 |
//===----------------------------------------------------------------------===// |
| 8 |
|
| 9 |
// UNSUPPORTED: !stdlib=libc++ && (c++03 || c++11 || c++14) |
| 10 |
|
| 11 |
// P2251 was voted into C++23, but is supported even in C++17 mode by all vendors. |
| 12 |
|
| 13 |
// <string_view> |
| 14 |
|
| 15 |
#include <string_view> |
| 16 |
#include <type_traits> |
| 17 |
|
| 18 |
#include "test_macros.h" |
| 19 |
|
| 20 |
static_assert(std::is_trivially_copyable<std::basic_string_view<char> >::value, ""); |
| 21 |
#ifndef TEST_HAS_NO_WIDE_CHARACTERS |
| 22 |
static_assert(std::is_trivially_copyable<std::basic_string_view<wchar_t> >::value, ""); |
| 23 |
#endif |
| 24 |
#ifndef TEST_HAS_NO_CHAR8_T |
| 25 |
static_assert(std::is_trivially_copyable<std::basic_string_view<char8_t> >::value, ""); |
| 26 |
#endif |
| 27 |
static_assert(std::is_trivially_copyable<std::basic_string_view<char16_t> >::value, ""); |
| 28 |
static_assert(std::is_trivially_copyable<std::basic_string_view<char32_t> >::value, ""); |