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