You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The regex [\d-e] (character class containing the range \d to e) is accepted (treated as \d, and the literal characters - and e), contrary to the ECMA-262 spec (\d isn't a single character, so it can't be used like that)
Both should be illegal (currently, only the latter is rejected)
STL version
Ask Godbolt
Additional context
Feel free to close this one as wontfix, if you feel it's ossified into a vendor extension. As long as it's a conscious choice, I'm fine with whichever outcome.
The text was updated successfully, but these errors were encountered:
We talked about this at the weekly maintainer meeting and we believe that this is clearly a bug, as we should be following what ECMAScript specifies here. (Technically the C++ Standard cites ECMAScript 3, but modern versions are written in a clearer way - we can refer to them as long as we don't accidentally pick up new features.)
As C++ Standard Library implementations have wildly varying behavior, @barcharcraz suggests checking what Chromium and Firefox do.
And even if the C++ spec is updated to cite a newer ES version, the spec explicitly calls out that they're backwards compat extensions that non-browsers should omit.
Describe the bug
The regex [\d-e] (character class containing the range \d to e) is accepted (treated as \d, and the literal characters - and e), contrary to the ECMA-262 spec (\d isn't a single character, so it can't be used like that)
Command-line test case
https://godbolt.org/z/oMvEr5YTs
Expected behavior
Both should be illegal (currently, only the latter is rejected)
STL version
Ask Godbolt
Additional context
Feel free to close this one as wontfix, if you feel it's ossified into a vendor extension. As long as it's a conscious choice, I'm fine with whichever outcome.
The text was updated successfully, but these errors were encountered: