diff --git a/libcxx/include/__locale b/libcxx/include/__locale --- a/libcxx/include/__locale +++ b/libcxx/include/__locale @@ -454,6 +454,7 @@ static const mask blank = _BLANK; static const mask __regex_word = 0x4000; // 0x8000 and 0x0100 and 0x00ff are used # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT +# define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA #elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) || defined(__NetBSD__) # ifdef __APPLE__ typedef __uint32_t mask; diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_1.pass.cpp @@ -13,7 +13,6 @@ // bool is(mask m, charT c) const; // REQUIRES: locale.en_US.UTF-8 -// XFAIL: LIBCXX-WINDOWS-FIXME // XFAIL: libcpp-has-no-wide-characters #include @@ -107,8 +106,16 @@ assert(f.is(F::graph, L'.')); assert(!f.is(F::graph, L'\x07')); +#if defined(_WIN32) + // On Windows, in the "C" locale, \x00DA is interpreted according + // to the current code page, where this char can be considered an + // uppercase alphabetical character. + assert(f.is(F::alpha, L'\x00DA')); + assert(f.is(F::upper, L'\x00DA')); +#else assert(!f.is(F::alpha, L'\x00DA')); assert(!f.is(F::upper, L'\x00DA')); +#endif } } diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/is_many.pass.cpp @@ -13,7 +13,6 @@ // const charT* do_is(const charT* low, const charT* high, mask* vec) const; // REQUIRES: locale.en_US.UTF-8 -// XFAIL: LIBCXX-WINDOWS-FIXME // XFAIL: libcpp-has-no-wide-characters #include @@ -149,17 +148,28 @@ // L'\x00DA' assert(!(m[0] & F::space)); - assert(!(m[0] & F::print)); assert(!(m[0] & F::cntrl)); - assert(!(m[0] & F::upper)); assert(!(m[0] & F::lower)); - assert(!(m[0] & F::alpha)); assert(!(m[0] & F::digit)); assert(!(m[0] & F::punct)); assert(!(m[0] & F::xdigit)); assert(!(m[0] & F::blank)); +#if defined(_WIN32) + // On Windows, in the "C" locale, \x00DA is interpreted according + // to the current code page, where this char can be considered an + // uppercase alphabetical character. + assert( (m[0] & F::alpha)); + assert( (m[0] & F::upper)); + assert( (m[0] & F::print)); + assert( (m[0] & F::alnum)); + assert( (m[0] & F::graph)); +#else + assert(!(m[0] & F::alpha)); + assert(!(m[0] & F::upper)); + assert(!(m[0] & F::print)); assert(!(m[0] & F::alnum)); assert(!(m[0] & F::graph)); +#endif // L' ' assert( (m[1] & F::space)); diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_is.pass.cpp @@ -13,7 +13,6 @@ // const charT* scan_is(mask m, const charT* low, const charT* high) const; // REQUIRES: locale.en_US.UTF-8 -// XFAIL: LIBCXX-WINDOWS-FIXME // XFAIL: libcpp-has-no-wide-characters #include @@ -57,17 +56,22 @@ const std::wstring in(L"\x00DA A\x07.a1"); std::vector m(in.size()); assert(f.scan_is(F::space, in.data(), in.data() + in.size()) - in.data() == 1); - assert(f.scan_is(F::print, in.data(), in.data() + in.size()) - in.data() == 1); assert(f.scan_is(F::cntrl, in.data(), in.data() + in.size()) - in.data() == 3); - assert(f.scan_is(F::upper, in.data(), in.data() + in.size()) - in.data() == 2); assert(f.scan_is(F::lower, in.data(), in.data() + in.size()) - in.data() == 5); - assert(f.scan_is(F::alpha, in.data(), in.data() + in.size()) - in.data() == 2); assert(f.scan_is(F::digit, in.data(), in.data() + in.size()) - in.data() == 6); assert(f.scan_is(F::punct, in.data(), in.data() + in.size()) - in.data() == 4); assert(f.scan_is(F::xdigit, in.data(), in.data() + in.size()) - in.data() == 2); assert(f.scan_is(F::blank, in.data(), in.data() + in.size()) - in.data() == 1); +#if !defined(_WIN32) + // On Windows, in the "C" locale, \x00DA is interpreted according + // to the current code page, where this char can be considered an + // uppercase alphabetical character. + assert(f.scan_is(F::print, in.data(), in.data() + in.size()) - in.data() == 1); + assert(f.scan_is(F::upper, in.data(), in.data() + in.size()) - in.data() == 2); + assert(f.scan_is(F::alpha, in.data(), in.data() + in.size()) - in.data() == 2); assert(f.scan_is(F::alnum, in.data(), in.data() + in.size()) - in.data() == 2); assert(f.scan_is(F::graph, in.data(), in.data() + in.size()) - in.data() == 2); +#endif } } diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp --- a/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp +++ b/libcxx/test/std/localization/locale.categories/category.ctype/locale.ctype.byname/scan_not.pass.cpp @@ -13,7 +13,6 @@ // const charT* scan_not(mask m, const charT* low, const charT* high) const; // REQUIRES: locale.en_US.UTF-8 -// XFAIL: LIBCXX-WINDOWS-FIXME // XFAIL: libcpp-has-no-wide-characters #include @@ -57,17 +56,22 @@ const std::wstring in(L"\x00DA A\x07.a1"); std::vector m(in.size()); assert(f.scan_not(F::space, in.data(), in.data() + in.size()) - in.data() == 0); - assert(f.scan_not(F::print, in.data(), in.data() + in.size()) - in.data() == 0); assert(f.scan_not(F::cntrl, in.data(), in.data() + in.size()) - in.data() == 0); - assert(f.scan_not(F::upper, in.data(), in.data() + in.size()) - in.data() == 0); assert(f.scan_not(F::lower, in.data(), in.data() + in.size()) - in.data() == 0); - assert(f.scan_not(F::alpha, in.data(), in.data() + in.size()) - in.data() == 0); assert(f.scan_not(F::digit, in.data(), in.data() + in.size()) - in.data() == 0); assert(f.scan_not(F::punct, in.data(), in.data() + in.size()) - in.data() == 0); assert(f.scan_not(F::xdigit, in.data(), in.data() + in.size()) - in.data() == 0); assert(f.scan_not(F::blank, in.data(), in.data() + in.size()) - in.data() == 0); +#if !defined(_WIN32) + // On Windows, in the "C" locale, \x00DA is interpreted according + // to the current code page, where this char can be considered an + // uppercase alphabetical character. + assert(f.scan_not(F::print, in.data(), in.data() + in.size()) - in.data() == 0); + assert(f.scan_not(F::upper, in.data(), in.data() + in.size()) - in.data() == 0); + assert(f.scan_not(F::alpha, in.data(), in.data() + in.size()) - in.data() == 0); assert(f.scan_not(F::alnum, in.data(), in.data() + in.size()) - in.data() == 0); assert(f.scan_not(F::graph, in.data(), in.data() + in.size()) - in.data() == 0); +#endif } }