Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[libcxx] Fix the ctype
is
(pointer version) function for Windows
Previously, this test snippet would report incorrect information: F::mask m; std::wstring in(L"\u00DA"); // LATIN CAPITAL LETTER U WITH ACUTE f.is(in.data(), in.data() + 1, &m); // m & F::lower would be set The single-character version of the `is` function wasn't affected by this issue though. Define `_LIBCPP_CTYPE_MASK_IS_COMPOSITE_ALPHA` for Windows, as the `alpha` / `_ALPHA` constant is a mask consisting of multiple bits set, which avoids setting `alpha` whenver any of the bits is set, in the `do_is` implementation. On Windows, with the "C" locale, wchars are classified according to their Unicode interpretation, just as in the en_US.UTF-8 locale on all platforms. Due to the differing classification of some characters, the `scan_is` and `scan_not` tests are quite annoying to fix, thus just ifdef out some of the tests for the "C" locale there - the code gets tested with the more standard en_US.UTF-8 locale anyway. Differential Revision: https://reviews.llvm.org/D120796
- Loading branch information
Showing
5 changed files
with
39 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters