[VPlan] Add and use debug location for VPScalarCastRecipe.
[llvm-project.git] / libcxx / test / std / strings / string.view / string.view.cons / default.pass.cpp
blob7f32553aa48e0bfb69b5a7a3bcdff35aeb460d93
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 //===----------------------------------------------------------------------===//
9 // UNSUPPORTED: !stdlib=libc++ && (c++03 || c++11 || c++14)
11 // <string_view>
13 // constexpr basic_string_view () noexcept;
15 #include <string_view>
16 #include <cassert>
18 #include "test_macros.h"
20 template <typename T>
21 void test() {
22 #if TEST_STD_VER > 11
24 ASSERT_NOEXCEPT(T());
26 constexpr T sv1;
27 static_assert(sv1.size() == 0, "");
28 static_assert(sv1.empty(), "");
30 #endif
33 T sv1;
34 assert(sv1.size() == 0);
35 assert(sv1.empty());
39 int main(int, char**) {
40 test<std::string_view>();
41 test<std::u16string_view>();
42 #ifndef TEST_HAS_NO_CHAR8_T
43 test<std::u8string_view>();
44 #endif
45 test<std::u32string_view>();
46 #ifndef TEST_HAS_NO_WIDE_CHARACTERS
47 test<std::wstring_view>();
48 #endif
50 return 0;