public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [ob/pushed] Fix a couple -Wdeprecated-copy issues
@ 2021-06-07 23:26 Pedro Alves
  0 siblings, 0 replies; only message in thread
From: Pedro Alves @ 2021-06-07 23:26 UTC (permalink / raw)
  To: gdb-patches

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-06-07 23:26 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-07 23:26 [ob/pushed] Fix a couple -Wdeprecated-copy issues Pedro Alves

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