From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 118554 invoked by alias); 21 Sep 2017 13:26:30 -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 118544 invoked by uid 89); 21 Sep 2017 13:26:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:743 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Sep 2017 13:26:29 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B403F5F7AE; Thu, 21 Sep 2017 13:26:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B403F5F7AE Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=palves@redhat.com Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id D67D8614E6; Thu, 21 Sep 2017 13:26:26 +0000 (UTC) Subject: Re: [RFA] Remove make_cleanup_restore_target_terminal To: Simon Marchi , Tom Tromey References: <20170920160404.20543-1-tom@tromey.com> <313985bd-111f-cea6-7b13-96217ee450cc@redhat.com> <87bmm5nhsw.fsf@tromey.com> Cc: gdb-patches@sourceware.org From: Pedro Alves Message-ID: <77e364fe-e0b9-de94-b6dd-ce759ee7400c@redhat.com> Date: Thu, 21 Sep 2017 13:26:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-SW-Source: 2017-09/txt/msg00632.txt.bz2 On 09/21/2017 02:15 PM, Simon Marchi wrote: > Clang gives this warning, which seems valid to me: > > /home/emaisin/src/binutils-gdb/gdb/utils.c:907:23: error: binding > reference member 'm_quit_handler' to a temporary value > [-Werror,-Wdangling-field] > : m_quit_handler (make_scoped_restore (&quit_handler, > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ > /home/emaisin/src/binutils-gdb/gdb/utils.c:931:18: note: reference > member declared here > scoped_restore m_quit_handler; > ^ Indeed. The field should be a scoped_restore_tmpl instead of a scoped_restore, and that mem-initializer above should be calling the scoped_restore_tmpl ctor instead of make_scoped_restore. Thanks, Pedro Alves