blob: 459f044e037a3a36ba0f4a50e83400e386bbe037 [file] [log] [blame]
Howard Hinnant70505302010-06-17 00:34:59 +00001// -*- C++ -*-
Howard Hinnanteb9e9a32010-09-28 17:19:10 +00002//===----------------------------------------------------------------------===//
Howard Hinnant70505302010-06-17 00:34:59 +00003//
Chandler Carruth57b08b02019-01-19 10:56:40 +00004// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5// See https://llvm.org/LICENSE.txt for license information.
6// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
Howard Hinnant70505302010-06-17 00:34:59 +00007//
8//===----------------------------------------------------------------------===//
9
Daniel Sanders61c115f2016-01-21 15:35:15 +000010// REQUIRES: locale.en_US.UTF-8
11
Howard Hinnant70505302010-06-17 00:34:59 +000012// <regex>
13
14// template <class charT> struct regex_traits;
15
16// regex_traits();
17
18#include <regex>
Howard Hinnant24757ff2010-06-21 21:01:43 +000019#include <cassert>
Howard Hinnant70505302010-06-17 00:34:59 +000020
Marshall Clowfd5ceb22016-04-26 16:24:44 +000021#include "test_macros.h"
Marshall Clow32227082013-01-05 03:21:01 +000022#include "platform_support.h" // locale name macros
Howard Hinnant33a30f42011-10-03 15:23:59 +000023
JF Bastien2df59c52019-02-04 20:31:13 +000024int main(int, char**)
Howard Hinnant70505302010-06-17 00:34:59 +000025{
Howard Hinnant24757ff2010-06-21 21:01:43 +000026 {
27 std::regex_traits<char> t1;
28 assert(t1.getloc().name() == "C");
29 std::regex_traits<wchar_t> t2;
30 assert(t2.getloc().name() == "C");
31 }
32 {
Howard Hinnant33a30f42011-10-03 15:23:59 +000033 std::locale::global(std::locale(LOCALE_en_US_UTF_8));
Howard Hinnant24757ff2010-06-21 21:01:43 +000034 std::regex_traits<char> t1;
Howard Hinnant33a30f42011-10-03 15:23:59 +000035 assert(t1.getloc().name() == LOCALE_en_US_UTF_8);
Howard Hinnant24757ff2010-06-21 21:01:43 +000036 std::regex_traits<wchar_t> t2;
Howard Hinnant33a30f42011-10-03 15:23:59 +000037 assert(t2.getloc().name() == LOCALE_en_US_UTF_8);
Howard Hinnant24757ff2010-06-21 21:01:43 +000038 }
JF Bastien2df59c52019-02-04 20:31:13 +000039
40 return 0;
Howard Hinnant70505302010-06-17 00:34:59 +000041}