diff --git a/stl/inc/regex b/stl/inc/regex index 4c04da603b8..f2c8f17f6be 100644 --- a/stl/inc/regex +++ b/stl/inc/regex @@ -164,7 +164,7 @@ namespace regex_constants { error_complexity, error_stack, _Error_parse, // TRANSITION, was error_parse, keeping behavior - error_syntax + _Error_syntax // TRANSITION, was error_syntax, keeping behavior }; } // namespace regex_constants @@ -574,7 +574,7 @@ private: "could match the specified character sequence."; case regex_constants::_Error_parse: // TRANSITION, keeping behavior return "regex_error(error_parse)"; - case regex_constants::error_syntax: + case regex_constants::_Error_syntax: return "regex_error(error_syntax)"; default: return "regex_error"; @@ -4596,7 +4596,7 @@ bool _Parser2<_FwdIt, _Elem, _RxTraits>::_Wrapped_disjunction() { // add disjunc --_Disj_count; return false; } else { - _Error(regex_constants::error_syntax); + _Error(regex_constants::error_badrepeat); } } else if (_Flags & regex_constants::nosubs) { _Do_noncapture_group(); @@ -5007,9 +5007,7 @@ _Root_node* _Parser2<_FwdIt, _Elem, _RxTraits>::_Compile() { // compile regular _Tidy_guard _Guard{_STD addressof(_Nfa)}; _Node_base* _Pos1 = _Nfa._Begin_capture_group(0); _Disjunction(); - if (_Pat != _End) { - _Error(regex_constants::error_syntax); - } + _STL_INTERNAL_CHECK(_Pat == _End); _Nfa._End_group(_Pos1); _Res = _Nfa._End_pattern(); diff --git a/tests/std/tests/GH_002206_unreserved_names/test.compile.pass.cpp b/tests/std/tests/GH_002206_unreserved_names/test.compile.pass.cpp index 754a28a48e0..2ccec3831f5 100644 --- a/tests/std/tests/GH_002206_unreserved_names/test.compile.pass.cpp +++ b/tests/std/tests/GH_002206_unreserved_names/test.compile.pass.cpp @@ -3,6 +3,7 @@ #define ISA_AVAILABILITY delete #define error_parse delete +#define error_syntax delete #define nsec delete #define sec delete #define xtime delete diff --git a/tests/std/tests/VSO_0000000_regex_use/test.cpp b/tests/std/tests/VSO_0000000_regex_use/test.cpp index 7160c9007fc..c927b2ff91c 100644 --- a/tests/std/tests/VSO_0000000_regex_use/test.cpp +++ b/tests/std/tests/VSO_0000000_regex_use/test.cpp @@ -307,8 +307,8 @@ void test_dev10_897466_regex_should_support_more_than_31_capture_groups() { } void test_regex_should_throw_for_lookbehind() { - g_regexTester.should_throw(R"((?<=abc))", error_syntax); - g_regexTester.should_throw(R"((?