//===----------------------------------------------------------------------===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // XFAIL: availability-char8_t_support-missing // This test runs in C++20, but we have deprecated codecvt in C++20. // ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS // // static const locale& classic(); #include #include #include "test_macros.h" template void check_for(const std::locale& loc) { assert(std::has_facet >(loc)); assert(std::has_facet >(loc)); assert((std::has_facet >(loc))); assert(std::has_facet >(loc)); assert(std::has_facet >(loc)); assert(std::has_facet >(loc)); assert(std::has_facet >(loc)); assert(std::has_facet >(loc)); assert(std::has_facet >(loc)); assert(std::has_facet >(loc)); assert(std::has_facet >(loc)); assert(std::has_facet >(loc)); } void check(const std::locale& loc) { check_for(loc); #ifndef TEST_HAS_NO_WIDE_CHARACTERS check_for(loc); #endif assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #if TEST_STD_VER > 17 assert((std::has_facet >(loc))); assert((std::has_facet >(loc))); #endif } int main(int, char**) { std::locale loc = std::locale::classic(); assert(loc.name() == "C"); assert(loc == std::locale("C")); check(loc); check(std::locale("C")); return 0; }