From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id AAF3A3854154; Thu, 11 Aug 2022 18:01:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org AAF3A3854154 From: "herring at lanl dot gov" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/89780] -Wpessimizing-move is too agressive with templates and recommends pessimization Date: Thu, 11 Aug 2022 18:01:43 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 9.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: herring at lanl dot gov X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mpolacek 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: Thu, 11 Aug 2022 18:01:43 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D89780 --- Comment #8 from S. Davis Herring --- I looked at P2266R3 again; it claims that the conversion function case (in = #7) is actually covered by P1825R0. I think that case is questionable, since it still refers to "overload resolution to select the constructor for the copy" and there's no constructor involved when a conversion function is used. (In particular, it isn't the case that the A object is converted to a Dest temporary that is then used as the argument to Dest(Dest&&), since that wou= ld be a second user-defined conversion.) If we consider the intent in P1155R3, though, it's pretty clear that that's just a wording oversight, so it's not unreasonable that GCC and Clang (but not ICC) accept template Dest withMove(); in C++20 mode. That means that we don't have to distinguish C++20 and C++23 for this discussion (at least outside of weirder cases like returning a reference).=