diff options
| author | Dan Albert <danalbert@google.com> | 2014-07-29 19:23:39 +0000 |
|---|---|---|
| committer | Dan Albert <danalbert@google.com> | 2014-07-29 19:23:39 +0000 |
| commit | 15c010a37e28f28b85fc08a3fa5c3b8090217500 (patch) | |
| tree | 99d13a684a6a5a943f50f8b453ef8baa58f7f38c /libcxx/include | |
| parent | 924e9e0226662e0673545d97ea6f3394a81388ad (diff) | |
| download | bcm5719-llvm-15c010a37e28f28b85fc08a3fa5c3b8090217500.tar.gz bcm5719-llvm-15c010a37e28f28b85fc08a3fa5c3b8090217500.zip | |
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
Diffstat (limited to 'libcxx/include')
| -rw-r--r-- | libcxx/include/regex | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libcxx/include/regex b/libcxx/include/regex index bebbaf09835..5e1c37c64e8 100644 --- a/libcxx/include/regex +++ b/libcxx/include/regex @@ -1192,7 +1192,8 @@ regex_traits<_CharT>::__lookup_collatename(_ForwardIterator __f, // lookup_classname -ctype_base::mask _LIBCPP_FUNC_VIS __get_classname(const char* __s, bool __icase); +regex_traits<char>::char_class_type _LIBCPP_FUNC_VIS +__get_classname(const char* __s, bool __icase); template <class _CharT> template <class _ForwardIterator> @@ -2184,8 +2185,8 @@ class __bracket_expression vector<pair<string_type, string_type> > __ranges_; vector<pair<_CharT, _CharT> > __digraphs_; vector<string_type> __equivalences_; - ctype_base::mask __mask_; - ctype_base::mask __neg_mask_; + typename regex_traits<_CharT>::char_class_type __mask_; + typename regex_traits<_CharT>::char_class_type __neg_mask_; bool __negate_; bool __icase_; bool __collate_; @@ -2281,10 +2282,10 @@ public: void __add_equivalence(const string_type& __s) {__equivalences_.push_back(__s);} _LIBCPP_INLINE_VISIBILITY - void __add_class(ctype_base::mask __mask) + void __add_class(typename regex_traits<_CharT>::char_class_type __mask) {__mask_ |= __mask;} _LIBCPP_INLINE_VISIBILITY - void __add_neg_class(ctype_base::mask __mask) + void __add_neg_class(typename regex_traits<_CharT>::char_class_type __mask) {__neg_mask_ |= __mask;} }; |

