diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index c5b6f88bf88..31be1141871 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -360,14 +360,13 @@ public: { } + DISABLE_COPY_AND_ASSIGN (scoped_restore_hook_in); + ~scoped_restore_hook_in () { m_cmd->hook_in = 0; } - scoped_restore_hook_in (const scoped_restore_hook_in &) = delete; - scoped_restore_hook_in &operator= (const scoped_restore_hook_in &) = delete; - private: struct cmd_list_element *m_cmd; diff --git a/gdb/interps.h b/gdb/interps.h index f048bf59a52..c9dbe3dbebd 100644 --- a/gdb/interps.h +++ b/gdb/interps.h @@ -232,14 +232,13 @@ public: { } + DISABLE_COPY_AND_ASSIGN (scoped_restore_interp); + ~scoped_restore_interp () { set_interp (m_interp->name ()); } - scoped_restore_interp (const scoped_restore_interp &) = delete; - scoped_restore_interp &operator= (const scoped_restore_interp &) = delete; - private: struct interp *set_interp (const char *name); diff --git a/gdb/language.h b/gdb/language.h index 196dd05bb1d..926d94405ea 100644 --- a/gdb/language.h +++ b/gdb/language.h @@ -836,6 +836,8 @@ public: /* Set the current language as well. */ explicit scoped_restore_current_language (enum language lang); + DISABLE_COPY_AND_ASSIGN (scoped_restore_current_language); + ~scoped_restore_current_language (); scoped_restore_current_language (scoped_restore_current_language &&other) @@ -845,11 +847,6 @@ public: other.dont_restore (); } - scoped_restore_current_language (const scoped_restore_current_language &) - = delete; - scoped_restore_current_language &operator= - (const scoped_restore_current_language &) = delete; - /* Cancel restoring on scope exit. */ void dont_restore () { diff --git a/gdb/skip.c b/gdb/skip.c index a56b3555d17..01a7aa6eb99 100644 --- a/gdb/skip.c +++ b/gdb/skip.c @@ -72,10 +72,6 @@ public: void enable () { m_enabled = true; }; void disable () { m_enabled = false; }; - /* Disable copy. */ - skiplist_entry (const skiplist_entry &) = delete; - void operator= (const skiplist_entry &) = delete; - private: /* Key that grants access to the constructor. */ struct private_key {}; @@ -87,6 +83,9 @@ public: bool function_is_regexp, std::string &&function, private_key); + /* Disable copy. */ + DISABLE_COPY_AND_ASSIGN (skiplist_entry); + private: /* Return true if we're stopped at a file to be skipped. */ bool do_skip_file_p (const symtab_and_line &function_sal) const; diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c index 0e2e70aa3ac..858a019e615 100644 --- a/gdb/target-descriptions.c +++ b/gdb/target-descriptions.c @@ -341,10 +341,9 @@ struct target_desc : tdesc_element target_desc () {} - virtual ~target_desc () = default; + DISABLE_COPY_AND_ASSIGN (target_desc); - target_desc (const target_desc &) = delete; - void operator= (const target_desc &) = delete; + virtual ~target_desc () = default; /* The architecture reported by the target, if any. */ const struct bfd_arch_info *arch = NULL; diff --git a/gdb/ui-out.h b/gdb/ui-out.h index 1796e9c9eb3..f3687c9cb95 100644 --- a/gdb/ui-out.h +++ b/gdb/ui-out.h @@ -307,14 +307,13 @@ class ui_out m_uiout->do_progress_start (); } + DISABLE_COPY_AND_ASSIGN (progress_update); + ~progress_update () { m_uiout->do_progress_end (); } - progress_update (const progress_update &) = delete; - progress_update &operator= (const progress_update &) = delete; - /* Emit some progress for this progress meter. Includes current amount of progress made and total amount in the display. */ void update_progress (const std::string& msg, const char *unit, @@ -445,8 +444,7 @@ public: m_uiout->table_end (); } - ui_out_emit_table (const ui_out_emit_table &) = delete; - ui_out_emit_table &operator= (const ui_out_emit_table &) = delete; + DISABLE_COPY_AND_ASSIGN (ui_out_emit_table); private: @@ -471,8 +469,7 @@ public: m_uiout->redirect (NULL); } - ui_out_redirect_pop (const ui_out_redirect_pop &) = delete; - ui_out_redirect_pop &operator= (const ui_out_redirect_pop &) = delete; + DISABLE_COPY_AND_ASSIGN (ui_out_redirect_pop); private: struct ui_out *m_uiout; diff --git a/gdb/utils.h b/gdb/utils.h index ddeac46b1da..0e28f9424e5 100644 --- a/gdb/utils.h +++ b/gdb/utils.h @@ -407,14 +407,11 @@ class scoped_restore_warning_hook public: explicit scoped_restore_warning_hook (warning_hook_handler new_handler); + DISABLE_COPY_AND_ASSIGN (scoped_restore_warning_hook); + ~scoped_restore_warning_hook (); private: - scoped_restore_warning_hook (const scoped_restore_warning_hook &other) - = delete; - scoped_restore_warning_hook &operator= (const scoped_restore_warning_hook &) - = delete; - warning_hook_handler m_save; }; diff --git a/gdbsupport/buildargv.h b/gdbsupport/buildargv.h index e2cc543e048..483d1987222 100644 --- a/gdbsupport/buildargv.h +++ b/gdbsupport/buildargv.h @@ -52,8 +52,7 @@ public: { } - gdb_argv (const gdb_argv &) = delete; - gdb_argv &operator= (const gdb_argv &) = delete; + DISABLE_COPY_AND_ASSIGN (gdb_argv); gdb_argv &operator= (gdb_argv &&other) { diff --git a/gdbsupport/cxx-thread.h b/gdbsupport/cxx-thread.h index e4061ebef9d..f734e241220 100644 --- a/gdbsupport/cxx-thread.h +++ b/gdbsupport/cxx-thread.h @@ -178,10 +178,11 @@ public: } future () = default; + + DISABLE_COPY_AND_ASSIGN (future); + future (future &&other) = default; - future (const future &other) = delete; future &operator= (future &&other) = default; - future &operator= (const future &other) = delete; void wait () const { } diff --git a/gdbsupport/gdb_argv_vec.h b/gdbsupport/gdb_argv_vec.h index 43571ae173a..147f7869a87 100644 --- a/gdbsupport/gdb_argv_vec.h +++ b/gdbsupport/gdb_argv_vec.h @@ -48,15 +48,15 @@ public: /* Nothing. */ } + /* Don't currently support copying the strings from OTHER. */ + DISABLE_COPY_AND_ASSIGN (argv_vec); + /* Move the owned strings from OTHER. */ argv_vec (argv_vec &&other) { this->m_args = std::move (other.m_args); } - /* Don't currently support copying the strings from OTHER. */ - argv_vec (const argv_vec &other) = delete; - /* Move elements from OTHER. Free currently owned strings. */ argv_vec &operator= (argv_vec &&other) { @@ -65,9 +65,6 @@ public: return *this; } - /* Don't currently support copying the strings from OTHER. */ - argv_vec &operator= (const argv_vec &other) = delete; - /* Release the owned strings. */ ~argv_vec () {