1 //===----------------------------------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
12 // Test for the existence of:
14 // basic_string typedef names
15 // typedef basic_string<char> string;
16 // typedef basic_string<char16_t> u16string;
17 // typedef basic_string<char8_t> u8string; // C++20
18 // typedef basic_string<char32_t> u32string;
19 // typedef basic_string<wchar_t> wstring;
22 #include <type_traits>
24 #include "test_macros.h"
28 static_assert((std::is_same<std::string, std::basic_string<char> >::value), "");
29 static_assert((std::is_same<std::wstring, std::basic_string<wchar_t> >::value), "");
30 #if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
31 static_assert((std::is_same<std::u8string, std::basic_string<char8_t> >::value), "");
33 #ifndef _LIBCPP_HAS_NO_UNICODE_CHARS
34 static_assert((std::is_same<std::u16string, std::basic_string<char16_t> >::value), "");
35 static_assert((std::is_same<std::u32string, std::basic_string<char32_t> >::value), "");
36 #endif // _LIBCPP_HAS_NO_UNICODE_CHARS