1 //===----------------------------------------------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is dual licensed under the MIT and the University of Illinois Open
6 // Source Licenses. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 // <string>
11
12 // Test for the existence of:
13
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;
20
21 #include <string>
22 #include <type_traits>
23
24 #include "test_macros.h"
25
main()26 int main()
27 {
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), "");
32 #endif
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
37 }
38