public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Pedro Alves <pedro@palves.net>
To: gdb-patches@sourceware.org
Subject: [ob/pushed] Fix a couple -Wdeprecated-copy issues
Date: Tue,  8 Jun 2021 00:26:55 +0100	[thread overview]
Message-ID: <20210607232655.1419237-1-pedro@palves.net> (raw)

Building GDB with current git (future 13) Clang runs into these two
issues:

#1:

 src/gdb/symtab.h:1139:3: error: definition of implicit copy assignment operator for 'symbol' is deprecated because it has a user-declared copy constructor [-Werror,-Wdeprecated-copy]
   symbol (const symbol &) = default;
   ^

#2:

 src/gdb/dwarf2/read.c:834:23: error: definition of implicit copy constructor for 'partial_die_info' is deprecated because it has a user-declared copy assignment operator [-Werror,-Wdeprecated-copy]
     partial_die_info& operator=(const partial_die_info& rhs) = delete;
		       ^

Fix them by adding the explicit defaulted versions of copy ctor and
copy-assign op appropriately.

gdb/ChangeLog:
yyyy-mm-dd  Pedro Alves  <pedro@palves.net>

	* dwarf2/read.c (struct partial_die_info): Add defaulted copy
	ctor.
	* symtab.h (struct symbol): Add defaulted copy assignment
	operator.
---
 gdb/ChangeLog     | 7 +++++++
 gdb/dwarf2/read.c | 1 +
 gdb/symtab.h      | 1 +
 3 files changed, 9 insertions(+)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 3026d383dd0..53d77aab62a 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2021-06-07  Pedro Alves  <pedro@palves.net>
+
+	* dwarf2/read.c (struct partial_die_info): Add defaulted copy
+	ctor.
+	* symtab.h (struct symbol): Add defaulted copy assignment
+	operator.
+
 2021-06-07  Pedro Alves  <pedro@palves.net>
 
 	* completer.c (RL_QF_SINGLE_QUOTE, RL_QF_DOUBLE_QUOTE)
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
index de79454a85f..96009f1418f 100644
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -832,6 +832,7 @@ struct partial_die_info : public allocate_on_obstack
     /* Disable assign but still keep copy ctor, which is needed
        load_partial_dies.   */
     partial_die_info& operator=(const partial_die_info& rhs) = delete;
+    partial_die_info (const partial_die_info &) = default;
 
     /* Adjust the partial die before generating a symbol for it.  This
        function may set the is_external flag or change the DIE's
diff --git a/gdb/symtab.h b/gdb/symtab.h
index efdbada9761..a5d0168faf0 100644
--- a/gdb/symtab.h
+++ b/gdb/symtab.h
@@ -1137,6 +1137,7 @@ struct symbol : public general_symbol_info, public allocate_on_obstack
     }
 
   symbol (const symbol &) = default;
+  symbol &operator= (const symbol &) = default;
 
   /* Data type of value */
 

base-commit: fa6ec8efa4b902f65a8057b5ee3ba0da456ec8c2
-- 
2.26.2


                 reply	other threads:[~2021-06-07 23:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20210607232655.1419237-1-pedro@palves.net \
    --to=pedro@palves.net \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).