[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
Tue Jan 25 14:25:53 PST 2022


mstorsjo added inline comments.


================
Comment at: libcxx/include/__locale:548
     _LIBCPP_INLINE_VISIBILITY ctype_base() {}
 };
 
----------------
Quuxplusone wrote:
> Could we realistically put a future-proofing `static_assert` down here, something like
> ```
> static_assert(__regex_word & ~(space | print | cntrl | upper | lower | alpha | digit | punct | xdigit | blank) == __regex_word);
> ```
> and I would expect
> ```
> static_assert(upper | lower == alpha);
> ```
> also? And/or, could we make a test for this?
I guess such a `static_assert` for `__regex_word` would be good to have, yes.

`static_assert(upper | lower == alpha);` doesn't hold on Windows, `_ALPHA` is defined as `0x0100 | _UPPER | _LOWER` actually.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D118188



More information about the libcxx-commits mailing list