[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
Mon Jan 31 13:14:11 PST 2022


This revision was automatically updated to reflect the committed changes.
Closed by commit rGeb9645819c6d: [libcxx] [Windows] Pick a unique bit for __regex_word (authored by mstorsjo).

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>
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__
@@ -545,6 +545,12 @@
     static const mask graph  = alnum | punct;
 
     _LIBCPP_INLINE_VISIBILITY ctype_base() {}
+
+// TODO: Remove the ifndef when the assert no longer fails on AIX.
+#ifndef _AIX
+    static_assert((__regex_word & ~(space | print | cntrl | upper | lower | alpha | digit | punct | xdigit | blank)) == __regex_word,
+                  "__regex_word can't overlap other bits");
+#endif
 };
 
 template <class _CharT> class _LIBCPP_TEMPLATE_VIS ctype;


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D118188.404698.patch
Type: text/x-patch
Size: 1886 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220131/be60d97d/attachment.bin>


More information about the libcxx-commits mailing list