Skip to content

<regex>: Constants in std​::​regex_constants are not constexpr variables #4100

Description

@frederick-vs-ja

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

Godbolt link

Additional context

libc++ is similarly buggy (llvm/llvm-project#69420).

Also tracked by VSO-498998 / AB#498998 .

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingregexmeow is a substring of homeowner

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions