[libcxx-commits] [PATCH] D118188: [libcxx] [Windows] Pick a unique bit for __regex_word

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jan 28 10:23:18 PST 2022


mstorsjo updated this revision to Diff 404081.
mstorsjo added a comment.

Moved the assert into a test, temporarily.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D118188/new/

https://reviews.llvm.org/D118188

Files:
  libcxx/include/__locale
  libcxx/test/std/re/re.traits/isctype.pass.cpp
  libcxx/test/std/re/re.traits/lookup_classname.pass.cpp


Index: libcxx/test/std/re/re.traits/lookup_classname.pass.cpp
===================================================================
--- libcxx/test/std/re/re.traits/lookup_classname.pass.cpp
+++ libcxx/test/std/re/re.traits/lookup_classname.pass.cpp
@@ -6,7 +6,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: LIBCXX-WINDOWS-FIXME
 // XFAIL: LIBCXX-AIX-FIXME
 
 // <regex>
@@ -23,6 +22,15 @@
 #include "test_macros.h"
 #include "test_iterators.h"
 
+// TODO: Move the assert to include/__locale when it passes on all platforms.
+static_assert((std::ctype_base::__regex_word &
+               ~(std::ctype_base::space | std::ctype_base::print |
+                 std::ctype_base::cntrl | std::ctype_base::upper |
+                 std::ctype_base::lower | std::ctype_base::alpha |
+                 std::ctype_base::digit | std::ctype_base::punct |
+                 std::ctype_base::xdigit | std::ctype_base::blank)) ==
+              std::ctype_base::__regex_word);
+
 template <class char_type>
 void
 test(const char_type* A,
Index: libcxx/test/std/re/re.traits/isctype.pass.cpp
===================================================================
--- libcxx/test/std/re/re.traits/isctype.pass.cpp
+++ libcxx/test/std/re/re.traits/isctype.pass.cpp
@@ -6,7 +6,6 @@
 //
 //===----------------------------------------------------------------------===//
 
-// XFAIL: LIBCXX-WINDOWS-FIXME
 // XFAIL: LIBCXX-AIX-FIXME
 
 // <regex>
Index: libcxx/include/__locale
===================================================================
--- libcxx/include/__locale
+++ libcxx/include/__locale
@@ -452,7 +452,7 @@
     static const mask punct  = _PUNCT;
     static const mask xdigit = _HEX;
     static const mask blank  = _BLANK;
-    static const mask __regex_word = 0x80;
+    static const mask __regex_word = 0x4000; // 0x8000 and 0x0100 and 0x00ff are used
 # define _LIBCPP_CTYPE_MASK_IS_COMPOSITE_PRINT
 #elif defined(__APPLE__) || defined(__FreeBSD__) || defined(__EMSCRIPTEN__) || defined(__NetBSD__)
 # ifdef __APPLE__


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118188.404081.patch
Type: text/x-patch
Size: 2072 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220128/2aea13d2/attachment-0001.bin>


More information about the libcxx-commits mailing list