-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
regex_traits<_Elem> uses static_cast<ctype_base::mask>(-1) to represent the character class "w":
Line 354 in 8124540
| _REGEX_CHAR_CLASS_NAME("w", static_cast<ctype_base::mask>(-1)), |
This is an inadmissible choice, because it violates [re.grammar]/9:
The results from multiple calls to
traits_inst.lookup_classnamecan be bitwise or'ed together and subsequently passed totraits_inst.isctype.
Specifically, or'ing the char_class_type for "w" with the char_class_type for any other character class always produces the value for "w" again, even if the combination should match more characters.
Additional remarks
I think resolving this issue will break ABI. However, it should be possible to mitigate the problems caused by this issue.
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.