From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id BD6383858430; Tue, 24 Aug 2021 19:34:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BD6383858430 From: "fstqwq at foxmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/102048] __gnu_cxx::rope.erase(size_t __p) implementation seems to be wrong Date: Tue, 24 Aug 2021 19:34:14 +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: X-Bugzilla-Severity: normal X-Bugzilla-Who: fstqwq at foxmail dot com 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: 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: Tue, 24 Aug 2021 19:34:14 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D102048 --- Comment #3 from Zonghan Yang --- I couldn't find document explicitly states how the function works but only = the line of comment above it shows the idea. So I guess it's just a small typo = but not found for years since no one really document it. In my opinion, it'd be better if it is consistent with std::string. Since current implementation is totally wrong, it's very unlikely that somebody really use this function historically (except unlucky wretches like me), it would be acceptable if we change the API. Or, deleting the function erase(size_t) itself instead of whole rope is als= o a good choice. From my point of view, rope is somehow useful in some specific tasks, so it'd be awesome if it can be kept it in libstdc++.=