[libc++] Keep __regex_word in sync with ctype_base

Summary:
The class ctype_base in the header <__locale> contains masks for
character classification functions, which are kept in sync with
platform's C library, hence it contains many special cases.
The value of the bit mask __regex_word in the header <regex> must not
clash with those bit masks.

Currently the default case (i.e. unknown platform/C library) is
handled incorrectly: the __regex_word clashes with ctype_base::punct.

To avoid replicating the whole list of platforms in <regex> this patch
defines __regex_word in <__locale>, so that it is always kept in sync
with other masks.

Reviewers: ldionne, mclow.lists, EricWF

Reviewed By: ldionne

Subscribers: krytarowski, christof, dexonsmith, pbarrio, simon_tatham, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D63284

llvm-svn: 363363
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 411c630bae0e0d50697651797709987e2cfea92d
diff --git a/include/regex b/include/regex
index 0db3c91..26efac1 100644
--- a/include/regex
+++ b/include/regex
@@ -1001,16 +1001,7 @@
     typedef locale                  locale_type;
     typedef ctype_base::mask        char_class_type;
 
-#if defined(__mips__) && defined(__GLIBC__)
-    static const char_class_type __regex_word = static_cast<char_class_type>(_ISbit(15));
-#elif defined(__NetBSD__)
-    // NetBSD defines classes up to 0x2000
-    // see sys/ctype_bits.h, _CTYPE_Q
-    static const char_class_type __regex_word = 0x8000;
-#else
-    static const char_class_type __regex_word = 0x80;
-#endif
-
+    static const char_class_type __regex_word = ctype_base::__regex_word;
 private:
     locale __loc_;
     const ctype<char_type>* __ct_;