This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [RFA] Remove make_cleanup_restore_target_terminal
- From: Pedro Alves <palves at redhat dot com>
- To: Simon Marchi <simon dot marchi at polymtl dot ca>, Tom Tromey <tom at tromey dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 21 Sep 2017 14:26:26 +0100
- Subject: Re: [RFA] Remove make_cleanup_restore_target_terminal
- Authentication-results: sourceware.org; auth=none
- 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 at redhat dot com
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com B403F5F7AE
- References: <20170920160404.20543-1-tom@tromey.com> <313985bd-111f-cea6-7b13-96217ee450cc@redhat.com> <87bmm5nhsw.fsf@tromey.com> <fd2d57293a7e49e4e06d1c5e31da6007@polymtl.ca>
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