brintos

brintos / llvm-project-archived public Read only

0
0
Text · 936 B · 36584f7 Raw
37 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// UNSUPPORTED: c++03, c++11, c++1410 11// <string_view>12 13// basic_string_view14 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_CHARACTERS28  {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#endif34 35  return 0;36}37