1//===----------------------------------------------------------------------===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9
10// <regex>
11
12// template <class charT> struct regex_traits;
13
14// locale_type getloc()const;
15
16#include <regex>
17#include <cassert>
18
19#include "platform_support.h" // locale name macros
20
21int main()
22{
23    {
24        std::regex_traits<char> t1;
25        assert(t1.getloc().name() == "C");
26        std::regex_traits<wchar_t> t2;
27        assert(t2.getloc().name() == "C");
28    }
29    {
30        std::locale::global(std::locale(LOCALE_en_US_UTF_8));
31        std::regex_traits<char> t1;
32        assert(t1.getloc().name() == LOCALE_en_US_UTF_8);
33        std::regex_traits<wchar_t> t2;
34        assert(t2.getloc().name() == LOCALE_en_US_UTF_8);
35    }
36}
37