[mlir] Update Ch-2.md (#121379)
[llvm-project.git] / libcxx / test / std / localization / c.locales / clocale.pass.cpp
blobe148fff741565bbfd38c4cef3488c27a31a53a82
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 //===----------------------------------------------------------------------===//
9 // <clocale>
11 #include <clocale>
12 #include <type_traits>
14 #include "test_macros.h"
16 #ifndef LC_ALL
17 #error LC_ALL not defined
18 #endif
20 #ifndef LC_COLLATE
21 #error LC_COLLATE not defined
22 #endif
24 #ifndef LC_CTYPE
25 #error LC_CTYPE not defined
26 #endif
28 #ifndef LC_MONETARY
29 #error LC_MONETARY not defined
30 #endif
32 #ifndef LC_NUMERIC
33 #error LC_NUMERIC not defined
34 #endif
36 #ifndef LC_TIME
37 #error LC_TIME not defined
38 #endif
40 #ifndef NULL
41 #error NULL not defined
42 #endif
44 int main(int, char**)
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), "");
51 return 0;