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