brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · ff817cb Raw
50 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// REQUIRES: locale.en_US.UTF-810 11// <regex>12 13// template <class charT> struct regex_traits;14 15// regex_traits();16 17#include <regex>18#include <cassert>19 20#include "test_macros.h"21#include "platform_support.h" // locale name macros22 23int main(int, char**)24{25    {26        std::regex_traits<char> t;27        assert(t.getloc().name() == "C");28    }29#ifndef TEST_HAS_NO_WIDE_CHARACTERS30    {31        std::regex_traits<wchar_t> t;32        assert(t.getloc().name() == "C");33    }34#endif35    {36        std::locale::global(std::locale(LOCALE_en_US_UTF_8));37        std::regex_traits<char> t;38        assert(t.getloc().name() == LOCALE_en_US_UTF_8);39    }40#ifndef TEST_HAS_NO_WIDE_CHARACTERS41    {42        std::locale::global(std::locale(LOCALE_en_US_UTF_8));43        std::regex_traits<wchar_t> t;44        assert(t.getloc().name() == LOCALE_en_US_UTF_8);45    }46#endif47 48  return 0;49}50