This patch fixes a bug where the regex parser doesn't advance the pointer
after reading the third character of an octal escape (in awk mode).

That is, regex{"\\141", awk} results in the regular expression /a1/ instead
of just /a/.

Here is the test case:

```
#include <regex>
#include <cassert>

int main()
{
    using std::regex_constants::awk;

    assert(std::regex_match("\4", std::regex{"\\4", awk}));
    assert(std::regex_match("\41", std::regex{"\\41", awk}));
    assert(std::regex_match("\141", std::regex{"\\141", awk}));
    assert(std::regex_match("\1411", std::regex{"\\1411", awk}));
}
```

Thanks.

Attachment: octal_escape.patch
Description: Binary data

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to