From c2f97536b77f9d9531a1a2c37008b454eb67a82e Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Thu, 21 Sep 2017 09:54:25 -0600 Subject: [PATCH] Change type of scoped_input_handler::m_quit_handler Simon pointed out that scoped_input_handler::m_quit_handler must have the correct scoped_restore_tmpl type, to avoid binding to a temporary. This patch fixes the problem. gdb/ChangeLog 2017-09-22 Tom Tromey * utils.c (class scoped_input_handler) : Change type to scoped_restore_tmpl. : Initialize m_quit_handler directly. Reviewed-By: Pedro Alves --- gdb/ChangeLog | 6 ++++++ gdb/utils.c | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 54eadaef98f..aa50dc9f5bb 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2017-09-22 Tom Tromey + + * utils.c (class scoped_input_handler) : Change + type to scoped_restore_tmpl. + : Initialize m_quit_handler directly. + 2017-09-22 Sergio Durigan Junior * cli/cli-cmds.c (pwd_command): Use "getcwd (NULL, 0)". diff --git a/gdb/utils.c b/gdb/utils.c index 9fea0f77b80..41ad35f1470 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -904,8 +904,7 @@ class scoped_input_handler public: scoped_input_handler () - : m_quit_handler (make_scoped_restore (&quit_handler, - default_quit_handler)), + : m_quit_handler (&quit_handler, default_quit_handler), m_ui (NULL) { target_terminal::ours (); @@ -928,7 +927,7 @@ private: target_terminal::scoped_restore_terminal_state m_term_state; /* Save and restore the quit handler. */ - scoped_restore m_quit_handler; + scoped_restore_tmpl m_quit_handler; /* The saved UI, if non-NULL. */ struct ui *m_ui; -- 2.30.2