Howard Hinnant | 7050530 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 1 | // -*- C++ -*- |
Howard Hinnant | eb9e9a3 | 2010-09-28 17:19:10 +0000 | [diff] [blame] | 2 | //===----------------------------------------------------------------------===// |
Howard Hinnant | 7050530 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 3 | // |
Chandler Carruth | 57b08b0 | 2019-01-19 10:56:40 +0000 | [diff] [blame] | 4 | // 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 Hinnant | 7050530 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
Daniel Sanders | 61c115f | 2016-01-21 15:35:15 +0000 | [diff] [blame] | 10 | // REQUIRES: locale.en_US.UTF-8 |
| 11 | |
Howard Hinnant | 7050530 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 12 | // <regex> |
| 13 | |
| 14 | // template <class charT> struct regex_traits; |
| 15 | |
| 16 | // regex_traits(); |
| 17 | |
| 18 | #include <regex> |
Howard Hinnant | 24757ff | 2010-06-21 21:01:43 +0000 | [diff] [blame] | 19 | #include <cassert> |
Howard Hinnant | 7050530 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 20 | |
Marshall Clow | fd5ceb2 | 2016-04-26 16:24:44 +0000 | [diff] [blame] | 21 | #include "test_macros.h" |
Marshall Clow | 3222708 | 2013-01-05 03:21:01 +0000 | [diff] [blame] | 22 | #include "platform_support.h" // locale name macros |
Howard Hinnant | 33a30f4 | 2011-10-03 15:23:59 +0000 | [diff] [blame] | 23 | |
JF Bastien | 2df59c5 | 2019-02-04 20:31:13 +0000 | [diff] [blame] | 24 | int main(int, char**) |
Howard Hinnant | 7050530 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 25 | { |
Howard Hinnant | 24757ff | 2010-06-21 21:01:43 +0000 | [diff] [blame] | 26 | { |
| 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 Hinnant | 33a30f4 | 2011-10-03 15:23:59 +0000 | [diff] [blame] | 33 | std::locale::global(std::locale(LOCALE_en_US_UTF_8)); |
Howard Hinnant | 24757ff | 2010-06-21 21:01:43 +0000 | [diff] [blame] | 34 | std::regex_traits<char> t1; |
Howard Hinnant | 33a30f4 | 2011-10-03 15:23:59 +0000 | [diff] [blame] | 35 | assert(t1.getloc().name() == LOCALE_en_US_UTF_8); |
Howard Hinnant | 24757ff | 2010-06-21 21:01:43 +0000 | [diff] [blame] | 36 | std::regex_traits<wchar_t> t2; |
Howard Hinnant | 33a30f4 | 2011-10-03 15:23:59 +0000 | [diff] [blame] | 37 | assert(t2.getloc().name() == LOCALE_en_US_UTF_8); |
Howard Hinnant | 24757ff | 2010-06-21 21:01:43 +0000 | [diff] [blame] | 38 | } |
JF Bastien | 2df59c5 | 2019-02-04 20:31:13 +0000 | [diff] [blame] | 39 | |
| 40 | return 0; |
Howard Hinnant | 7050530 | 2010-06-17 00:34:59 +0000 | [diff] [blame] | 41 | } |