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 // <codecvt> 10 11 // template <class Elem, unsigned long Maxcode = 0x10ffff, 12 // codecvt_mode Mode = (codecvt_mode)0> 13 // class codecvt_utf16 14 // : public codecvt<Elem, char, mbstate_t> 15 // { 16 // // unspecified 17 // }; 18 19 // int encoding() const throw(); 20 21 #include <codecvt> 22 #include <cassert> 23 24 #include "test_macros.h" 25 26 int main(int, char**) 27 { 28 #ifndef TEST_HAS_NO_WIDE_CHARACTERS 29 { 30 typedef std::codecvt_utf16<wchar_t> C; 31 C c; 32 int r = c.encoding(); 33 assert(r == 0); 34 } 35 #endif 36 { 37 typedef std::codecvt_utf16<char16_t> C; 38 C c; 39 int r = c.encoding(); 40 assert(r == 0); 41 } 42 { 43 typedef std::codecvt_utf16<char32_t> C; 44 C c; 45 int r = c.encoding(); 46 assert(r == 0); 47 } 48 49 return 0; 50 } 51