Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions stl/inc/regex
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)";
Comment on lines 575 to 578
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No change requested: It would be more consistent to follow the pattern of commenting // TRANSITION, keeping behavior here, but the comment on the enumerator definition is sufficient. This isn't worth resetting testing.

default:
return "regex_error";
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -5007,9 +5007,7 @@ _Root_node* _Parser2<_FwdIt, _Elem, _RxTraits>::_Compile() { // compile regular
_Tidy_guard<decltype(_Nfa)> _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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions tests/std/tests/VSO_0000000_regex_use/test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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"((?<!abc))", error_syntax);
g_regexTester.should_throw(R"((?<=abc))", error_badrepeat);
g_regexTester.should_throw(R"((?<!abc))", error_badrepeat);
}

void test_regex_simple_loop_detection_enters_alternations_and_assertions() {
Expand Down