Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<regex> syntax_option_type is not a proper bitmask #35315

Closed
miyuki opened this issue Jan 16, 2018 · 3 comments
Closed

<regex> syntax_option_type is not a proper bitmask #35315

miyuki opened this issue Jan 16, 2018 · 3 comments
Labels
bugzilla Issues migrated from bugzilla libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Comments

@miyuki
Copy link
Collaborator

miyuki commented Jan 16, 2018

Bugzilla Link 35967
Resolution FIXED
Resolved on Mar 28, 2019 10:32
Version 6.0
OS Linux
CC @hubert-reinterpretcast,@mclow

Extended Description

According to [re.synopt]:
"The type syntax_option_type is an implementation-defined bitmask type"

[bitmask.types] defines some requirements for such types, specifically:
"Here, the names C0, C1, etc. represent bitmask elements for this particular bitmask type. All such elements have distinct, nonzero values"

Contrarily to this requirement, in libc++ std::regex_constants::ECMAScript is 0.

@hubert-reinterpretcast
Copy link
Collaborator

As mentioned in http://lists.llvm.org/pipermail/cfe-dev/2016-October/051290.html,
the use of "0" breaks use cases like the following:
bool isEcmaScript(::std::regex_constants::syntax_option_type v) {
return v & ::std::regex_constants::ECMAScript;
}

@mclow
Copy link
Contributor

mclow commented Jan 16, 2018

We've got some ABI-breaking stuff coming for
When that happens, we'll circle back to this.

@mclow
Copy link
Contributor

mclow commented Mar 28, 2019

Fixed in commit 357190. Note that this requires a new dylib.
(and is an ABI break, so it's off by default)

Also, I looked at 'format_default' and 'match_default', but they're defined as empty bitmasks, so they stayed == 0.

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 10, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugzilla Issues migrated from bugzilla libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
None yet
Development

No branches or pull requests

3 participants