From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101250 invoked by alias); 20 Aug 2018 14:03:40 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 101182 invoked by uid 89); 20 Aug 2018 14:03:34 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,KAM_SHORT,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 spammy=online X-HELO: smtp.polymtl.ca Received: from smtp.polymtl.ca (HELO smtp.polymtl.ca) (132.207.4.11) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 20 Aug 2018 14:03:33 +0000 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id w7KE3Q4V024771 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Mon, 20 Aug 2018 10:03:31 -0400 Received: by simark.ca (Postfix, from userid 112) id C9B031EA1D; Mon, 20 Aug 2018 10:03:26 -0400 (EDT) Received: from simark.ca (localhost [127.0.0.1]) by simark.ca (Postfix) with ESMTP id 4F8AC1E012; Mon, 20 Aug 2018 10:03:25 -0400 (EDT) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 20 Aug 2018 14:03:00 -0000 From: Simon Marchi To: Tom Tromey Cc: Keith Seitz , gdb-patches@sourceware.org Subject: Re: [PATCH 5/9] Change decode_compound_collector to use std::vector In-Reply-To: <87d0udqiah.fsf@tromey.com> References: <20180810232534.481-1-keiths@redhat.com> <20180810232534.481-6-keiths@redhat.com> <87pnypt086.fsf@tromey.com> <9675ef7a-9d3c-5dfb-3f56-e43d80eb02d5@redhat.com> <87d0udqiah.fsf@tromey.com> Message-ID: <4e2a6dbfac801dcf7be9634767a332eb@polymtl.ca> X-Sender: simon.marchi@polymtl.ca User-Agent: Roundcube Webmail/1.3.6 X-IsSubscribed: yes X-SW-Source: 2018-08/txt/msg00463.txt.bz2 On 2018-08-20 09:28, Tom Tromey wrote: >>>>>> "Simon" == Simon Marchi writes: > > Simon> I've always read that it was bad to use std::move on a return > value: > Simon> > https://diego.assencio.com/?index=f57f25fd5a187c70fc7f34fcf5374773 > Simon> though in this case it seems like the right thing to do. > > It would be nice if gcc warned when a std::move was either redundant or > recommended. Maybe this is > > https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86981 > > ... I thought I heard that clang 8 has a new warning in this area but I > couldn't find it anywhere online, only a hint here: > > https://bugzilla.mozilla.org/show_bug.cgi?id=1483985 > > So I'm not really sure how to file this. > > Tom Ah ok, but at least the wording of the warning confirms that this case here is fine: moving a local object in a return statement prevents copy elision Here, we are not moving a local object. Simon