53 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9// <clocale>10 11#include <clocale>12#include <type_traits>13 14#include "test_macros.h"15 16#ifndef LC_ALL17#error LC_ALL not defined18#endif19 20#ifndef LC_COLLATE21#error LC_COLLATE not defined22#endif23 24#ifndef LC_CTYPE25#error LC_CTYPE not defined26#endif27 28#ifndef LC_MONETARY29#error LC_MONETARY not defined30#endif31 32#ifndef LC_NUMERIC33#error LC_NUMERIC not defined34#endif35 36#ifndef LC_TIME37#error LC_TIME not defined38#endif39 40#ifndef NULL41#error NULL not defined42#endif43 44int main(int, char**)45{46 std::lconv lc;47 ((void)lc); // Prevent unused warning48 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