[libcxx-commits] [PATCH] D136708: [libcxx] Disable assert when building with newlib

Tom Hughes via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 25 11:45:09 PDT 2022


tomhughes created this revision.
Herald added a project: All.
tomhughes requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

newlib defines blank as 0200 (0x80) (see newlib/libc/include/ctype.h),
which is the same as __regex_word, so the static_assert fails. However,
"mask" is only a single byte, so we don't have room to expand.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D136708

Files:
  libcxx/include/__locale


Index: libcxx/include/__locale
===================================================================
--- libcxx/include/__locale
+++ libcxx/include/__locale
@@ -549,8 +549,10 @@
 
     _LIBCPP_INLINE_VISIBILITY ctype_base() {}
 
+#ifndef _NEWLIB_VERSION
     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: D136708.470582.patch
Type: text/x-patch
Size: 521 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20221025/b8049f3f/attachment-0001.bin>


More information about the libcxx-commits mailing list