From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id D10903858293; Wed, 9 Nov 2022 02:37:32 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D10903858293 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667961452; bh=+Ufie+wlLlYiQLi902mOEOLh9KrNcFTnWbIv96M6mgM=; h=From:To:Subject:Date:In-Reply-To:References:From; b=MQWm+LXLDgk1fxdeCmgXopPZS+murd+LCDpU5y6aV0+mUyhpoi1MxxkW1sYtpjeB5 MXM3t5NKxTsR9Ta83OB3iJhUQFywiH9cYwzyPXlkWbPqIxe32MyOEUOQbrg9plkN0t m/hZRzYDzWsFu2dJTL5xwOy5JJZiKIn7albGV6RU= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/107363] Wrong caret location for "redundant move in return statement" and nvo Date: Wed, 09 Nov 2022 02:37:31 +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: 13.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D107363 --- Comment #3 from CVS Commits --- The trunk branch has been updated by Marek Polacek : https://gcc.gnu.org/g:b305793b985f4d3e0032b04d446b8baabcb3e8b7 commit r13-3822-gb305793b985f4d3e0032b04d446b8baabcb3e8b7 Author: Marek Polacek Date: Fri Oct 28 13:39:40 2022 -0400 c++: Tweaks for -Wredundant-move [PR107363] Two things here: 1) when we're pointing out that std::move on a constant object is redundant, don't say "in return statement" when we aren't in a return statement; 2) suppress the warning when the std::move call was dependent, because removing the std::move may not be correct for a different instantiation of the original template. PR c++/107363 gcc/cp/ChangeLog: * semantics.cc (finish_call_expr): Suppress OPT_Wpessimizing_mo= ve. * typeck.cc (maybe_warn_pessimizing_move): Check warn_redundant_move and warning_suppressed_p. Adjust a message depending on return= _p. (check_return_expr): Don't suppress OPT_Wpessimizing_move here. gcc/testsuite/ChangeLog: * g++.dg/cpp0x/Wredundant-move13.C: New test.=