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 // typedef int category; 12 13 #include <locale> 14 #include <type_traits> 15 #include <cassert> 16 17 #include "test_macros.h" 18 19 template <class T> test(const T &)20void test(const T &) {} 21 22 main(int,char **)23int main(int, char**) 24 { 25 static_assert((std::is_same<std::locale::category, int>::value), ""); 26 assert(std::locale::none == 0); 27 assert(std::locale::collate); 28 assert(std::locale::ctype); 29 assert(std::locale::monetary); 30 assert(std::locale::numeric); 31 assert(std::locale::time); 32 assert(std::locale::messages); 33 assert((std::locale::collate 34 & std::locale::ctype 35 & std::locale::monetary 36 & std::locale::numeric 37 & std::locale::time 38 & std::locale::messages) == 0); 39 assert((std::locale::collate 40 | std::locale::ctype 41 | std::locale::monetary 42 | std::locale::numeric 43 | std::locale::time 44 | std::locale::messages) 45 == std::locale::all); 46 47 test(std::locale::none); 48 test(std::locale::collate); 49 test(std::locale::ctype); 50 test(std::locale::monetary); 51 test(std::locale::numeric); 52 test(std::locale::time); 53 test(std::locale::messages); 54 test(std::locale::all); 55 56 return 0; 57 } 58