public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/111713] New: libstdc++ accepts regular expression
@ 2023-10-06  9:28 hewillk at gmail dot com
  2023-10-06  9:29 ` [Bug libstdc++/111713] libstdc++ accepts invalid " hewillk at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: hewillk at gmail dot com @ 2023-10-06  9:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 111713
           Summary: libstdc++ accepts regular expression
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

#include <regex>
#include <iostream>
#include <cassert>

int main() {
  std::regex invalid_re("AAA\\s*(\\w+*)"); // should throw
  std::smatch match;
  std::string str("AAA BBB");
  assert(std::regex_match(str, match, invalid_re));
  std::cout << match[1] << "\n"; // libstdc++ prints BBB
}

https://godbolt.org/z/1zrv1Wf71

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-10-07 11:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-06  9:28 [Bug libstdc++/111713] New: libstdc++ accepts regular expression hewillk at gmail dot com
2023-10-06  9:29 ` [Bug libstdc++/111713] libstdc++ accepts invalid " hewillk at gmail dot com
2023-10-06  9:48 ` pinskia at gcc dot gnu.org
2023-10-07 11:32 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).