blob: c9a97e025ac5bf6026621209efddb9a9ef0fb6f9 [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//
4// The LLVM Compiler Infrastructure
5//
Howard Hinnant412dbeb2010-11-16 22:09:02 +00006// This file is dual licensed under the MIT and the University of Illinois Open
7// Source Licenses. See LICENSE.TXT for details.
Howard Hinnant70505302010-06-17 00:34:59 +00008//
9//===----------------------------------------------------------------------===//
10
11// <regex>
12
13// template <class charT> struct regex_traits;
14
15// regex_traits();
16
17#include <regex>
Howard Hinnant24757ff2010-06-21 21:01:43 +000018#include <cassert>
Howard Hinnant70505302010-06-17 00:34:59 +000019
Marshall Clow32227082013-01-05 03:21:01 +000020#include "platform_support.h" // locale name macros
Howard Hinnant33a30f42011-10-03 15:23:59 +000021
Howard Hinnant70505302010-06-17 00:34:59 +000022int main()
23{
Howard Hinnant24757ff2010-06-21 21:01:43 +000024 {
25 std::regex_traits<char> t1;
26 assert(t1.getloc().name() == "C");
27 std::regex_traits<wchar_t> t2;
28 assert(t2.getloc().name() == "C");
29 }
30 {
Howard Hinnant33a30f42011-10-03 15:23:59 +000031 std::locale::global(std::locale(LOCALE_en_US_UTF_8));
Howard Hinnant24757ff2010-06-21 21:01:43 +000032 std::regex_traits<char> t1;
Howard Hinnant33a30f42011-10-03 15:23:59 +000033 assert(t1.getloc().name() == LOCALE_en_US_UTF_8);
Howard Hinnant24757ff2010-06-21 21:01:43 +000034 std::regex_traits<wchar_t> t2;
Howard Hinnant33a30f42011-10-03 15:23:59 +000035 assert(t2.getloc().name() == LOCALE_en_US_UTF_8);
Howard Hinnant24757ff2010-06-21 21:01:43 +000036 }
Howard Hinnant70505302010-06-17 00:34:59 +000037}