diff --git a/libcxx/include/regex b/libcxx/include/regex --- a/libcxx/include/regex +++ b/libcxx/include/regex @@ -4438,6 +4438,9 @@ __ml->__add_char('_'); ++__first; break; + default: + __ml = __start_matching_list(true); + ++__first; } } return __first; diff --git a/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp b/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp --- a/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp +++ b/libcxx/test/std/re/re.alg/re.alg.match/ecma.pass.cpp @@ -1391,6 +1391,17 @@ assert(m.position(0) == 0); assert(m.str(0) == s); } + { + // LWG#2584: identity escapes. Match exact chars/strings. + const std::regex r1("\\z"); + assert(std::regex_match("z", r1)); + + const std::regex r2("\\zz"); + assert(std::regex_match("zz", r2)); + + const std::regex r3("\\zx"); + assert(std::regex_match("zx", r3)); + } return 0; } diff --git a/libcxx/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp b/libcxx/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp --- a/libcxx/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp +++ b/libcxx/test/std/re/re.regex/re.regex.construct/bad_escape.pass.cpp @@ -32,15 +32,11 @@ int main(int, char**) { assert(error_escape_thrown("[\\a]")); - assert(error_escape_thrown("\\a")); assert(error_escape_thrown("\\")); assert(error_escape_thrown("[\\e]")); - assert(error_escape_thrown("\\e")); assert(error_escape_thrown("[\\c:]")); - assert(error_escape_thrown("\\c:")); - assert(error_escape_thrown("\\c")); assert(!error_escape_thrown("[\\cA]")); assert(!error_escape_thrown("\\cA")); diff --git a/libcxx/www/cxx1z_status.html b/libcxx/www/cxx1z_status.html --- a/libcxx/www/cxx1z_status.html +++ b/libcxx/www/cxx1z_status.html @@ -392,7 +392,7 @@ 2569conjunction and disjunction requirements are too strictIssaquahComplete 2570[fund.ts.v2] conjunction and disjunction requirements are too strictIssaquah 2578Iterator requirements should reference iterator traitsIssaquahComplete - 2584 ECMAScript IdentityEscape is ambiguousIssaquah + 2584 ECMAScript IdentityEscape is ambiguousIssaquahComplete 2587"Convertible to bool" requirement in conjunction and disjunctionIssaquahResolved by 2567 2588[fund.ts.v2] "Convertible to bool" requirement in conjunction and disjunctionIssaquah 2589match_results can't satisfy the requirements of a containerIssaquahComplete