blob: 224efd71aafd8d8312a8e424f5a77a8528c4f226 [file] [log] [blame]
Howard Hinnant70505302010-06-17 00:34:59 +00001//===----------------------------------------------------------------------===//
2//
3// The LLVM Compiler Infrastructure
4//
Howard Hinnant412dbeb2010-11-16 22:09:02 +00005// This file is dual licensed under the MIT and the University of Illinois Open
6// Source Licenses. See LICENSE.TXT for details.
Howard Hinnant70505302010-06-17 00:34:59 +00007//
8//===----------------------------------------------------------------------===//
9
10// <regex>
11
12// template <class charT> struct regex_traits;
13
14// locale_type imbue(locale_type l);
15
16#include <regex>
Howard Hinnant24757ff2010-06-21 21:01:43 +000017#include <locale>
18#include <cassert>
Howard Hinnant70505302010-06-17 00:34:59 +000019
Howard Hinnant33a30f42011-10-03 15:23:59 +000020#include "../../platform_support.h" // locale name macros
21
Howard Hinnant70505302010-06-17 00:34:59 +000022int main()
23{
Howard Hinnant24757ff2010-06-21 21:01:43 +000024 {
25 std::regex_traits<char> t;
Howard Hinnant33a30f42011-10-03 15:23:59 +000026 std::locale loc = t.imbue(std::locale(LOCALE_en_US_UTF_8));
Howard Hinnant24757ff2010-06-21 21:01:43 +000027 assert(loc.name() == "C");
Howard Hinnant33a30f42011-10-03 15:23:59 +000028 assert(t.getloc().name() == LOCALE_en_US_UTF_8);
Howard Hinnant24757ff2010-06-21 21:01:43 +000029 }
Howard Hinnant70505302010-06-17 00:34:59 +000030}