xref: /aosp_15_r20/external/cronet/third_party/libc++/src/test/std/localization/c.locales/clocale.pass.cpp (revision 6777b5387eb2ff775bb5750e3f5d96f37fb7352b)
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 // <clocale>
10 
11 #include <clocale>
12 #include <type_traits>
13 
14 #include "test_macros.h"
15 
16 #ifndef LC_ALL
17 #error LC_ALL not defined
18 #endif
19 
20 #ifndef LC_COLLATE
21 #error LC_COLLATE not defined
22 #endif
23 
24 #ifndef LC_CTYPE
25 #error LC_CTYPE not defined
26 #endif
27 
28 #ifndef LC_MONETARY
29 #error LC_MONETARY not defined
30 #endif
31 
32 #ifndef LC_NUMERIC
33 #error LC_NUMERIC not defined
34 #endif
35 
36 #ifndef LC_TIME
37 #error LC_TIME not defined
38 #endif
39 
40 #ifndef NULL
41 #error NULL not defined
42 #endif
43 
main(int,char **)44 int main(int, char**)
45 {
46     std::lconv lc;
47     ((void)lc); // Prevent unused warning
48     static_assert((std::is_same<decltype(std::setlocale(0, "")), char*>::value), "");
49     static_assert((std::is_same<decltype(std::localeconv()), std::lconv*>::value), "");
50 
51   return 0;
52 }
53