From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 260D33858D39; Tue, 28 Mar 2023 16:25:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 260D33858D39 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680020709; bh=+6u3HRE82JeE0V2e4qfBjXrU0VWvs6/kINYeotuPcMQ=; h=From:To:Subject:Date:In-Reply-To:References:From; b=EDuPxSHOyJW0yIiXQJE+9EkC3+O+24UMpCBlCd+4p7FgUJp1g2VW3H1sy8E/XHMkx IUkgVWk1ZI3UiJsiy07aFzL7gHXxR2DQaJbkEAML3iHZfP+upcHJ/9wz0ns+00cWsK mwleH7PYnwJLLb0zdkLXElg4Xk3fJzcBgicczInc= From: "chgros 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:25:09 +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: chgros at synopsys dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: INVALID 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 #7 from Charles-Henri Gros --- For context, we're trying to detect cases where using "auto" unintentionally creates a copy (it's regrettably common). Here the copy is necessary to get a non-const value; that's definitely something we could consider. Thank you for your feedback.=