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 // template<> struct char_traits<wchar_t> 13 14 // static void assign(char_type& c1, const char_type& c2); 15 // constexpr in C++17 16 17 #include <string> 18 #include <cassert> 19 20 #include "test_macros.h" 21 22 #if TEST_STD_VER > 14 test_constexpr()23constexpr bool test_constexpr() 24 { 25 wchar_t c = L'1'; 26 std::char_traits<wchar_t>::assign(c, L'a'); 27 return c == L'a'; 28 } 29 #endif 30 main()31int main() 32 { 33 wchar_t c = L'\0'; 34 std::char_traits<wchar_t>::assign(c, L'a'); 35 assert(c == L'a'); 36 37 #if TEST_STD_VER > 14 38 static_assert(test_constexpr(), "" ); 39 #endif 40 } 41