From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AE2203858296; Mon, 18 Mar 2024 14:06:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AE2203858296 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1710770800; bh=L7miUpswAAxS+qZ/9OLvICKoQP1S2vp+p+2r98vO2d4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Nu0mB1dQIJOBg4ewihbabcgJq+AYmO3ZaJRoxJubBREI+xxKlS+4OPMH+iQj5QiG2 6EXJj9qFiLhhSfKcsk1nKPqMWX0JJDUaPk1cuYzpmKIFkTzur8jU3QykZWfnN+agpd 61ocALeAoGK2zdt9vOfV2sTTo7ZkoNjzhseYu80M= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/107376] regex executor requires allocator to be default constructible Date: Mon, 18 Mar 2024 14:06:38 +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: 13.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: 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=3D107376 --- Comment #4 from GCC Commits --- The releases/gcc-12 branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:5c156f5be49007a5434452335f29844eb17868a6 commit r12-10258-g5c156f5be49007a5434452335f29844eb17868a6 Author: Jonathan Wakely Date: Tue Oct 25 13:03:12 2022 +0100 libstdc++: Fix allocator propagation in regex algorithms [PR107376] The PR points out that we assume the match_results allocator is default constuctible, which might not be true. We also have a related issue with unwanted propagation from an object that might have an unequal allocator. Ideally we use the same allocator type for _State_info::_M_match_queue but that would be an ABI change now. We should investigate if that can be done without breaking anything, which might be possible because the _Executor object is short-lived and never leaks out of the regex_match, regex_search, and regex_replace algorithms. If we change the mangled name for _Executor then there would be no ODR violations when mixing old and new definitions. This commit does not attempt that. libstdc++-v3/ChangeLog: PR libstdc++/107376 * include/bits/regex_executor.h (_Executor::_Executor): Use same allocator for _M_cur_results and _M_results. * include/bits/regex_executor.tcc (_Executor::_M_main_dispatch): Prevent possibly incorrect allocator propagating to _M_cur_results. * testsuite/28_regex/algorithms/regex_match/107376.cc: New test. (cherry picked from commit 988dd22ec6665117e8587389ac85389f1c321c45)=