From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E97AA3858C39; Fri, 1 Oct 2021 10:24:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E97AA3858C39 From: "redi at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/102447] std::regex incorrectly accepts invalid bracket expression Date: Fri, 01 Oct 2021 10:24:57 +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: 12.0 X-Bugzilla-Keywords: accepts-invalid 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: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: resolution bug_status 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Oct 2021 10:24:58 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102447 Jonathan Wakely changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|INVALID |--- Status|RESOLVED |NEW --- Comment #4 from Jonathan Wakely --- Reopening. JavaScript engines in web browsers accept invalid regexes for le= gacy support: https://262.ecma-international.org/#sec-additional-ecmascript-features-for-= web-browsers If we're not implementing a browser engine, then it should be a syntax erro= r: NonemptyClassRanges :: ClassAtom - ClassAtom ClassRanges It is a Syntax Error if IsCharacterClass of the first ClassAtom is true= or IsCharacterClass of the second ClassAtom is true. It is a Syntax Error if IsCharacterClass of the first ClassAtom is false and IsCharacterClass of the second ClassAtom is false and the CharacterValu= e of the first ClassAtom is larger than the CharacterValue of the second ClassAt= om.=