[PATCH] Add a missing munmap_list move constructor

Saagar Jha saagar@saagarjha.com
Fri Sep 25 07:05:25 GMT 2020


compile_module attempts to request a move constructor, but because
munmap_list doesn't have one it gets implicitly deleted. This is an
warning on clang under -Wdefaulted-function-deleted (which is enabled by
default):

In file included from compile/compile-object-load.c:21:
compile/compile-object-load.h:56:3: error: explicitly defaulted move constructor is implicitly deleted [-Werror,-Wdefaulted-function-deleted]
  compile_module (compile_module &&other) = default;
  ^
compile/compile-object-load.h:86:22: note: move constructor of 'compile_module' is implicitly deleted because field 'munmap_list' has a deleted move constructor
  struct munmap_list munmap_list;
                     ^
compile/compile-object-load.h:30:28: note: 'munmap_list' has been explicitly marked deleted here
  DISABLE_COPY_AND_ASSIGN (munmap_list);
                           ^

gdb/ChangeLog:

	* compile/compile-object-load.h: Give munmap_list a move
	constructor.
---
 gdb/ChangeLog                     | 5 +++++
 gdb/compile/compile-object-load.h | 1 +
 2 files changed, 6 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 3872a8d9cb..043c6a4c72 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-09-25  Saagar Jha  <saagar@saagarjha.com>
+
+	* compile/compile-object-load.h: Give munmap_list a move
+	constructor.
+
 2020-09-24  Tom Tromey  <tromey@adacore.com>
 
 	PR tui/26638:
diff --git a/gdb/compile/compile-object-load.h b/gdb/compile/compile-object-load.h
index 0254390109..166d442ad0 100644
--- a/gdb/compile/compile-object-load.h
+++ b/gdb/compile/compile-object-load.h
@@ -30,6 +30,7 @@ struct munmap_list
   DISABLE_COPY_AND_ASSIGN (munmap_list);
 
   munmap_list &operator= (munmap_list &&) = default;
+  munmap_list (munmap_list &&) = default;
 
   /* Add a region to the list.  */
   void add (CORE_ADDR addr, CORE_ADDR size);
-- 
2.28.0



More information about the Gdb-patches mailing list