From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id C07D63858C2B; Thu, 24 Aug 2023 15:16:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C07D63858C2B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1692890172; bh=C4Cv75fn7gY01wdfTYEu6EUwZNRVccvab7XICqiWHC8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ri81ZKum7TSlKCTawYvnXwSaT6bhZjtBnBviBc56blViYcvv28IcJy5nPeFtWoLKx HmVLjRvvZmRAUiNDKgfHvYAScXbuFvhucap1pJ/eEar7ebLfvjJ2xRtjg1eMQfN49S HK9KBa0utjjiS+qdzdxmNUKVQGzMdMy4zNp23TDQ= From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/111129] std::regex incorrectly matches quantifiers with plus appended Date: Thu, 24 Aug 2023 15:16:12 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: redi at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D111129 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |timshen at gcc dot gnu.org --- Comment #2 from Jonathan Wakely --- This changed with r0-127716-g053eb1f31ede72 * include/bits/regex_compiler.h (_Comipler<>::_M_quantifier()): Fix parse error of multiple consecutive quantifiers like "a**". * include/bits/regex_compiler.tcc (_Comipler<>::_M_quantifier()= ): Likewise. * testsuite/28_regex/basic_regex/multiple_quantifiers.cc: New. That added the following tests: regex re1("a++"); regex re2("(a+)+"); The second one is fine, but the first is invalid. The "a**" case mentioned = in the commit message is invalid too. I don't know why Tim wanted to accept the first one. ECMAscript and POSIX d= on't accept it. My GNU grep does, but I think that's just a bug in glibc's regco= mp: https://sourceware.org/bugzilla/show_bug.cgi?id=3D20095=