Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Saagar Jha <saagar@saagarjha.com>
To: gdb-patches@sourceware.org
Subject: [PATCH] Add a missing munmap_list move constructor
Date: Wed, 23 Sep 2020 22:22:00 -0700	[thread overview]
Message-ID: <58351270-2804-4A48-ABA5-2589312C06B6@saagarjha.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 339 bytes --]

Clang warns if the default implementation of a function is requested but it is implicitly deleted. This was happening to compile_module because it didn’t have a move constructor for its munmap_list member, so I went ahead and added one since it already had a move assignment operator defined for it and this seemed like an oversight.


[-- Attachment #2: Add-a-missing-munmap_list-move-constructor.patch --]
[-- Type: application/octet-stream, Size: 1486 bytes --]

From 3ed7e54dfc5b3ab0a6033a239f8d6a457cb91f92 Mon Sep 17 00:00:00 2001
From: Saagar Jha <saagar@saagarjha.com>
Date: Wed, 23 Sep 2020 22:16:17 -0700
Subject: [PATCH] Add a missing munmap_list move constructor

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).

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 241f3e7027..3aa3255b37 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2020-09-23  Saagar Jha  <saagar@saagarjha.com>
+
+	* compile/compile-object-load.h: Give munmap_list a move
+	constructor.
+
 2020-09-23  Tom Tromey  <tom@tromey.com>
 
 	PR symtab/25470:
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


             reply	other threads:[~2020-09-24  5:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-24  5:22 Saagar Jha [this message]
2020-09-24 15:27 ` Simon Marchi
2020-09-25  6:59   ` Saagar Jha
2020-09-25  7:05     ` Saagar Jha
2020-09-25  7:05       ` Saagar Jha
2020-09-25 14:58       ` Simon Marchi
2020-09-26  0:25         ` Saagar Jha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=58351270-2804-4A48-ABA5-2589312C06B6@saagarjha.com \
    --to=saagar@saagarjha.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox