Base regex code on char_class_type.
__get_classname() and __bracket_expression were assuming that
char_class_type was ctype_base::mask rather than using
regex_traits<_CharT>::char_class_type.
This change allows char_class_type to be defined to something other than
ctype_base::mask so that the implementation will still work for
platforms with an 8-bit ctype mask (such as Android and OpenBSD).
llvm-svn: 214201
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 15c010a37e28f28b85fc08a3fa5c3b8090217500
diff --git a/src/regex.cpp b/src/regex.cpp
index fb820e2..17dd6ea 100644
--- a/src/regex.cpp
+++ b/src/regex.cpp
@@ -207,7 +207,7 @@
struct classnames
{
const char* elem_;
- ctype_base::mask mask_;
+ regex_traits<char>::char_class_type mask_;
};
#if defined(__clang__)
@@ -254,12 +254,12 @@
return r;
}
-ctype_base::mask
+regex_traits<char>::char_class_type
__get_classname(const char* s, bool __icase)
{
const classnames* i =
_VSTD::lower_bound(begin(ClassNames), end(ClassNames), s, use_strcmp());
- ctype_base::mask r = 0;
+ regex_traits<char>::char_class_type r = 0;
if (i != end(ClassNames) && strcmp(s, i->elem_) == 0)
{
r = i->mask_;