[PATCH] [libcxx] Fix match_results for alternatives
Marshall Clow
mclow.lists at gmail.com
Fri Jan 23 09:13:18 PST 2015
The fix looks reasonable, it fixes the OP's problem, and the new test fails w/o the fix.
However, the change to <regex> is in two places, and I don't see how this test exercises both code paths.
Other than that (and the nits in the test) this looks good.
================
Comment at: test/std/re/re.results/re.results.acc/index.pass.cpp:25
@@ -25,2 +24,3 @@
+ assert(std::regex_search(s, m, std::regex("cd((e)fg)hi|(z)")));
assert(m[0].first == s+2);
----------------
How about `assert(m.size() == 6)` here? - or `>5` since we're checking elements 0..5
================
Comment at: test/std/re/re.results/re.results.acc/index.pass.cpp:48
@@ -45,1 +47,3 @@
+ assert(m[5].second == s+11);
+ assert(m[4].matched == false);
}
----------------
Should this be `m[5]` ?
http://reviews.llvm.org/D7111
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the cfe-commits
mailing list