Skip to content

<regex>: Goofy message for error_badbrace #4993

@Alcaro

Description

@Alcaro

Describe the bug

The error_badbrace string is significantly goofy looking

Command-line test case

#include <regex>

int main()
{
    try {
        std::regex r("a{4,3}");
        puts("it's legal");
    } catch (std::exception& e) {
        puts(e.what());
    }
}

https://godbolt.org/z/Y14Exavx7

Expected behavior

The expression contained an invalid range in a {} expression.

Actual behavior

The expression contained an invalid range in a { expression }.

Why was the closing brace moved one word to the right? That's neither consistent with the C++ spec, nor with my understanding of English grammar.

STL version

Don't know, ask Godbolt

Additional context

Probably a good first issue Good for newcomers

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSomething can be improvedfixedSomething works now, yay!good first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions