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 // <locale>
10
11 // class moneypunct<charT, International>
12
13 // string_type curr_symbol() const;
14
15 // The C++ and C standards are silent.
16 // POSIX standard is being followed (as a guideline).
17
18 #include <locale>
19 #include <limits>
20 #include <cassert>
21
22 #include "test_macros.h"
23
24 typedef std::moneypunct<char> F;
25
26 class Fnf
27 : public std::moneypunct<char, false>
28 {
29 public:
Fnf(std::size_t refs=0)30 explicit Fnf(std::size_t refs = 0)
31 : std::moneypunct<char, false>(refs) {}
32 };
33
34 class Fnt
35 : public std::moneypunct<char, true>
36 {
37 public:
Fnt(std::size_t refs=0)38 explicit Fnt(std::size_t refs = 0)
39 : std::moneypunct<char, true>(refs) {}
40 };
41
42 class Fwf
43 : public std::moneypunct<wchar_t, false>
44 {
45 public:
Fwf(std::size_t refs=0)46 explicit Fwf(std::size_t refs = 0)
47 : std::moneypunct<wchar_t, false>(refs) {}
48 };
49
50 class Fwt
51 : public std::moneypunct<wchar_t, true>
52 {
53 public:
Fwt(std::size_t refs=0)54 explicit Fwt(std::size_t refs = 0)
55 : std::moneypunct<wchar_t, true>(refs) {}
56 };
57
main(int,char **)58 int main(int, char**)
59 {
60 {
61 Fnf f(1);
62 assert(f.curr_symbol() == std::string());
63 }
64 {
65 Fnt f(1);
66 assert(f.curr_symbol() == std::string());
67 }
68 {
69 Fwf f(1);
70 assert(f.curr_symbol() == std::wstring());
71 }
72 {
73 Fwt f(1);
74 assert(f.curr_symbol() == std::wstring());
75 }
76
77 return 0;
78 }
79