• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 // <codecvt>
11 
12 // template <class Elem, unsigned long Maxcode = 0x10ffff,
13 //           codecvt_mode Mode = (codecvt_mode)0>
14 // class codecvt_utf8
15 //     : public codecvt<Elem, char, mbstate_t>
16 // {
17 //     // unspecified
18 // };
19 
20 // result
21 //     unshift(stateT& state,
22 //             externT* to, externT* to_end, externT*& to_next) const;
23 
24 #include <codecvt>
25 #include <cassert>
26 
main()27 int main()
28 {
29     {
30         typedef std::codecvt_utf8<wchar_t> C;
31         C c;
32         char n[4] = {0};
33         std::mbstate_t m;
34         char* np = nullptr;
35         std::codecvt_base::result r = c.unshift(m, n, n+4, np);
36         assert(r == std::codecvt_base::noconv);
37     }
38     {
39         typedef std::codecvt_utf8<char16_t> C;
40         C c;
41         char n[4] = {0};
42         std::mbstate_t m;
43         char* np = nullptr;
44         std::codecvt_base::result r = c.unshift(m, n, n+4, np);
45         assert(r == std::codecvt_base::noconv);
46     }
47     {
48         typedef std::codecvt_utf8<char32_t> C;
49         C c;
50         char n[4] = {0};
51         std::mbstate_t m;
52         char* np = nullptr;
53         std::codecvt_base::result r = c.unshift(m, n, n+4, np);
54         assert(r == std::codecvt_base::noconv);
55     }
56 }
57