This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] Remove make_cleanup_restore_target_terminal


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]