diff --git a/stl/inc/regex b/stl/inc/regex index 5491b129ed0..e58c47066bd 100644 --- a/stl/inc/regex +++ b/stl/inc/regex @@ -334,10 +334,7 @@ public: template char_class_type lookup_classname(_Iter _First, _Iter _Last, bool _Icase = false) const { // map [_First, _Last) to character class mask value -#define _REGEX_CHAR_CLASS_NAME(n, c) \ - { \ - n, L##n, static_cast(_STD size(n) - 1), c \ - } +#define _REGEX_CHAR_CLASS_NAME(n, c) {n, L##n, static_cast(_STD size(n) - 1), c} static constexpr _Cl_names _Names[] = { // map class names to numeric constants _REGEX_CHAR_CLASS_NAME("alnum", _Ch_alnum), @@ -3575,15 +3572,14 @@ bool _Matcher<_BidIt, _Elem, _RxTraits, _It>::_Match_pat(_Node_base* _Nx) { // c case _N_neg_assert: case _N_assert: { // check assert - _It _Ch = _Tgt_state._Cur; bool _Neg = _Nx->_Kind == _N_neg_assert; _Bt_state_t<_It> _St = _Tgt_state; if (_Match_pat(static_cast<_Node_assert*>(_Nx)->_Child) == _Neg) { // restore initial state and indicate failure _Tgt_state = _St; _Failed = true; - } else { - _Tgt_state._Cur = _Ch; + } else if (!_Neg) { + _Tgt_state._Cur = _St._Cur; } break;