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: c++03, c++11, c++14
10
11// <string_view>
12
13// basic_string_view
14
15// Make sure that the implicitly-generated CTAD works.
16
17#include <string_view>
18
19#include "test_macros.h"
20
21int main(int, char**) {
22 {
23 char const* str = "hello world";
24 std::basic_string_view sv(str);
25 ASSERT_SAME_TYPE(decltype(sv), std::basic_string_view<char>);
26 }
27#ifndef TEST_HAS_NO_WIDE_CHARACTERS
28 {
29 wchar_t const* str = L"hello world";
30 std::basic_string_view sv(str);
31 ASSERT_SAME_TYPE(decltype(sv), std::basic_string_view<wchar_t>);
32 }
33#endif
34
35 return 0;
36}
37

source code of libcxx/test/std/strings/string.view/string.view.deduct/implicit.pass.cpp