diff --git a/libcxx/include/regex b/libcxx/include/regex --- a/libcxx/include/regex +++ b/libcxx/include/regex @@ -4421,6 +4421,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,25 @@ assert(m.position(0) == 0); assert(m.str(0) == s); } + { // Issue2584: identify escape. 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("\\zz"); + // assert(std::regex_match("zzz", r3)); + + const std::regex r4("\\zx"); + assert(std::regex_match("zx", r4)); + + // const std::regex r5("\\zx"); + // assert(std::regex_match("zxx", r5)); + + // const std::regex r6("\\zx"); + // assert(std::regex_match("zxz", r6)); + } return 0; } 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 disjunctionIssaquah 2588[fund.ts.v2] "Convertible to bool" requirement in conjunction and disjunctionIssaquah 2589match_results can't satisfy the requirements of a containerIssaquahComplete