Issue 135048
Summary [libc++] `<regex>`: `\00` should be rejected
Labels libc++
Assignees
Reporter Alcaro
    ```c++
#include <regex>
#include <stdio.h>

int main() {
    try {
        std::regex r{"\\00"};
        puts("valid");
    } catch (const std::exception& e) {
        printf("not valid: %s\n", e.what());
    }
    try {
 std::regex r{"\\01"};
        puts("valid");
    } catch (const std::exception& e) {
        printf("not valid: %s\n", e.what());
 }
}
```
Expected: Reject them. 00 and 01 do not match DecimalIntegerLiteral in the JS spec, and lookahead can't be a digit either.
Actual: Both are valid. (Can't find what they're actually parsed as, though.)

https://godbolt.org/z/heM1o1aGe (MS-STL is busy fixing it https://github.com/microsoft/STL/pull/5380)
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to