Open BillyONeal opened 4 years ago
We checked libstdc++ and libc++'s behavior, and it's as Tolkien said: "go not to the STLs for advice, for they will tell you error_syntax
and error_paren
and error_badrepeat
" :elf: : https://godbolt.org/z/nvPz5rnaf
There should definitely be an LWG issue for this, ideally saying exactly which error code should be thrown (or [re] should be dropped entirely :smirk_cat: :unicorn: :joy_cat:).
Removing vNext because we believe that although this would be a behavioral change, it wouldn't break ABI (it's worth noting that we've gotten more aggressive about behavioral changes since the beginning of the GitHub era). Of course, we would need to preserve the values of all existing error code constants.
Changing the error code of the exception being thrown, and/or removing the identifier error_syntax
, could be done without realistically disrupting any code (it is unlikely that code is out there that is depending on the exact error code value being thrown for bogus syntax, or mentioning our non-Standard undocumented error constant).
Describe the bug The standard has a set of
std::regex_constants
values defined for regex errors, but doesn't define a value for every possible kind of error; for example, an empty pattern that only contains lookbehind. We probably need to add the missing constant to the standard somehow.Boost uses
error_bad_pattern
for this case.Command-line test case STL version (git commit or Visual Studio version): Visual Studio 2019 version 16.4
Expected behavior The standard should describe every possible value
regex_error::code()
can return.This is a dual of Microsoft-internal VSO-173840 / AB#173840.
vNext note: Resolving this issue will require breaking binary compatibility. We won't be able to accept pull requests for this issue until the vNext branch is available. See #169 for more information.