https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109993

            Bug ID: 109993
           Summary: std::regex("\\a", std::regex::basic) does not diagnose
                    invalid BRE
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: redi at gcc dot gnu.org
            Blocks: 102445
  Target Milestone: ---

#include <regex>
int main()
{
 std::regex("\\a", std::regex::basic);
}

This should throw a std::regex_error exception.

https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap09.html#tag_09_03

"The interpretation of an ordinary character preceded by an unescaped
<backslash> ( '\\' ) is undefined, except for: [...]"


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102445
[Bug 102445] [meta-bug] std::regex issues

Reply via email to