From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 1A0EF38582BC; Tue, 28 Mar 2023 16:04:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1A0EF38582BC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680019449; bh=D96iztLNlvwqg+EZM6nKua1a8dwsLaZkgWcapN4i0Yc=; h=From:To:Subject:Date:In-Reply-To:References:From; b=N4ese11LmxFHEjNswew2GHGn4ffUQg42NAiYLMD1tu2agHZvgEUKwcHWAvn4LYBBh YsgYSecWT+kA+M04aU8sjZCz+1/3M93Zim+mwt5QQ7pi2cE90U/UMPMSvg2u7P3rzs sUeJEE0fRm0BdWFrAvYIuglGUc1brjost4RsuBU0= From: "marc-andre.laverdiere at synopsys dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/109305] Allocator copy in basic_string::operator= Date: Tue, 28 Mar 2023 16:04:08 +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.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: marc-andre.laverdiere at synopsys dot com X-Bugzilla-Status: WAITING 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109305 --- Comment #4 from Marc-Andr=C3=A9 Laverdi=C3=A8re --- The comment is "If this allocation throws there are no effects:" and I didn= 't understand the implications. Thanks for you spelled it out the logic behind= it. May I encourage you to update the comment? As to why a local copy could be a problem, it's an efficiency (rather than correctness) issue here. Removing unnecessary copies is always a plus. From= the explanations I got, that copy is necessary - or at least, removing it would= be complex.=