pr42199
When using regex_constants::match_prev_avail, it is defined that
--first is valid, and match_not_bol and match_not_bow should be
ignored. At the moment these flags are not ignored. This fixis that.
Details
- Reviewers
ldionne miyuki EricWF mclow.lists - Group Reviewers
Restricted Project - Commits
- rGc14ac8043ed1: [FIX][libc++][Regex] Using regex_constants match_prev_avail | match_not_bol |…
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Hi @EricWF, thanks for the review.
Indeed there seems to have some other unrelated issue for matching the word boundary \b. Perhaps I wrongly assumed that it should also match line beginning and end.
For example, I would expect all these matches to succeed:
cout << regex_match("a", regex("\ba")) << "\n" << regex_match("a", regex("a\b")) << "\n" << regex_match("a", regex("\ba\b")) << "\n" << regex_match("a", regex("a")) << "\n";
But what I get is:
0 0 0 1
So it is unrelated in how match_not_bow is ignored when using match_prev_avail. I would rather open a defect for that apart.
Thanks for your patience. I'm fine with this. @EricWF Please post-commit review this if you still have issues with it.
This seems to have broken the ASAN bot. Could you please take a quick look?
http://lab.llvm.org:8011/builders/libcxx-libcxxabi-x86_64-linux-ubuntu-asan/builds/3207/steps/test.libcxx/logs/FAIL%3A%20libc%2B%2B%3A%3Amatch_prev_avail.pass.cpp
Also pasted at https://gist.github.com/ldionne/b85d28805bdf1550b0b59a96146f4b81 cause I don't know when the build bot logs go away.
Hi, @ldionne
I just submitted a what I think is the test fix. It was the only place I was not using the second element of the string and could generate a underflow.
Please fix the FIXME.