From d6541620447f43985b34e9a39488bafb38158221 Mon Sep 17 00:00:00 2001 From: Yao Qi Date: Tue, 19 Sep 2017 10:10:03 +0100 Subject: Use DISABLE_COPY_AND_ASSIGN We have many classes that copy cotr and assignment operator are deleted, so this patch replaces these existing mechanical code with macro DISABLE_COPY_AND_ASSIGN. gdb: 2017-09-19 Yao Qi * annotate.h (struct annotate_arg_emitter): Use DISABLE_COPY_AND_ASSIGN. * common/refcounted-object.h (refcounted_object): Likewise. * completer.h (struct completion_result): Likewise. * dwarf2read.c (struct dwarf2_per_objfile): Likewise. * filename-seen-cache.h (filename_seen_cache): Likewise. * gdbcore.h (thread_section_name): Likewise. * gdb_regex.h (compiled_regex): Likewise. * gdbthread.h (scoped_restore_current_thread): Likewise. * inferior.h (scoped_restore_current_inferior): Likewise. * jit.c (jit_reader): Likewise. * linespec.h (struct linespec_result): Likewise. * mi/mi-parse.h (struct mi_parse): Likewise. * nat/fork-inferior.c (execv_argv): Likewise. * progspace.h (scoped_restore_current_program_space): Likewise. * python/python-internal.h (class gdbpy_enter): Likewise. * regcache.h (regcache): Likewise. * target-descriptions.c (struct tdesc_reg): Likewise. (struct tdesc_type): Likewise. (struct tdesc_feature): Likewise. * ui-out.h (ui_out_emit_type): Likewise. --- gdb/common/refcounted-object.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'gdb/common') diff --git a/gdb/common/refcounted-object.h b/gdb/common/refcounted-object.h index 9d0ac10..9711680 100644 --- a/gdb/common/refcounted-object.h +++ b/gdb/common/refcounted-object.h @@ -45,9 +45,7 @@ public: int refcount () const { return m_refcount; } private: - /* Disable copy. */ - refcounted_object (const refcounted_object &) = delete; - refcounted_object &operator=(const refcounted_object &) = delete; + DISABLE_COPY_AND_ASSIGN (refcounted_object); /* The reference count. */ int m_refcount = 0; -- cgit v1.1