From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id E4CD8386102D; Thu, 11 Jan 2024 20:55:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org E4CD8386102D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1705006543; bh=4RyQGQH3v0mlbt06H6m8pvmgzgGX3JfQyC5/e8ZXFcM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=AyW6cGnPgmNFsvj+Kgjw2KBlgqOI1Oi+qp7RmdeMR1/MyxyLlz97W6A+aNovmkSCN QAsakUpX7CayavUwUNA6LKIWljVlbbHlEb0A7mIHDFoW6DeDgcm2YafJywEpgchund Xcymtl1SjCXENZJxaOtTcf9VcfsH7xkWowXwsBY4= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/112477] [13/14 Regression] Assignment of value-initialized iterators differs from value-initialization Date: Thu, 11 Jan 2024 20:55:43 +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.2.1 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: fdumont at gcc dot gnu.org X-Bugzilla-Target-Milestone: 13.3 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=3D112477 --- Comment #11 from GCC Commits --- The releases/gcc-13 branch has been updated by Francois Dumont : https://gcc.gnu.org/g:ffc5684a4d3d3c457e5d311e7088f3487cf5083e commit r13-8212-gffc5684a4d3d3c457e5d311e7088f3487cf5083e Author: Fran=C3=A7ois Dumont Date: Wed Jan 10 19:06:48 2024 +0100 libstdc++: [_GLIBCXX_DEBUG] Fix assignment of value-initialized iterator [PR112477] Now that _M_Detach do not reset iterator _M_version value we need to re= set it when the iterator is attached to a new sequence. Even if this sequence is nu= ll like when assigning a value-initialized iterator. In this case _M_version shall be reset to 0. libstdc++-v3/ChangeLog: PR libstdc++/112477 * src/c++11/debug.cc (_Safe_iterator_base::_M_attach): Reset _M_version to 0 if attaching to null sequence. (_Safe_iterator_base::_M_attach_single): Likewise. (_Safe_local_iterator_base::_M_attach): Likewise. (_Safe_local_iterator_base::_M_attach_single): Likewise. * testsuite/23_containers/map/debug/112477.cc: New test case. Reviewed-by: Jonathan Wakely =