`<regex>`: Constants in `std::regex_constants` are not `constexpr` variables
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 11.1k
- Forks
- 1.7k
- Avg merge
- 4d 15h
- Merged PRs (30d)
- 22
Description
Describe the bug
The Standard specified that constants in std::regex_constants to be constexpr variables ([re.const]).
However, MSVC STL just implements them as enumerators of unscoped enumerations, which are not variables.
It seems that they have never been specified be to non-object. In TR1 (WG21-N1836) they were static const variables.
Command-line test case
Additional context
libc++ is similarly buggy (llvm/llvm-project#69420).
Also tracked by VSO-498998 / AB#498998 .
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the std::regex_constants entry point and compare the MSVC STL implementation with the linked Standard specification. Use the provided Godbolt test case to inspect the current declarations and verify that the affected constants are represented as constexpr variables when the fix is complete.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100