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