public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Simon Marchi <simark@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] gdb: remove move constructor and move assignment operator from cooked_index
Date: Thu, 14 Apr 2022 15:32:39 +0000 (GMT)	[thread overview]
Message-ID: <20220414153239.187B33857342@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=df4397e378fa6813301e80c08fd1358aa07697df

commit df4397e378fa6813301e80c08fd1358aa07697df
Author: Simon Marchi <simon.marchi@polymtl.ca>
Date:   Thu Apr 14 11:32:34 2022 -0400

    gdb: remove move constructor and move assignment operator from cooked_index
    
    Building with clang++-14, I see:
    
          CXX    dwarf2/cooked-index.o
        In file included from /home/smarchi/src/binutils-gdb/gdb/dwarf2/cooked-index.c:21:
        /home/smarchi/src/binutils-gdb/gdb/dwarf2/cooked-index.h:172:12: error: explicitly defaulted move constructor is implicitly deleted [-Werror,-Wdefaulted-function-deleted]
          explicit cooked_index (cooked_index &&other) = default;
                   ^
        /home/smarchi/src/binutils-gdb/gdb/dwarf2/cooked-index.h:225:16: note: move constructor of 'cooked_index' is implicitly deleted because field 'm_storage' has a deleted move constructor
          auto_obstack m_storage;
                       ^
        /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/gdb_obstack.h:128:28: note: 'auto_obstack' has been explicitly marked deleted here
          DISABLE_COPY_AND_ASSIGN (auto_obstack);
                                   ^
        In file included from /home/smarchi/src/binutils-gdb/gdb/dwarf2/cooked-index.c:21:
        /home/smarchi/src/binutils-gdb/gdb/dwarf2/cooked-index.h:174:17: error: explicitly defaulted move assignment operator is implicitly deleted [-Werror,-Wdefaulted-function-deleted]
          cooked_index &operator= (cooked_index &&other) = default;
                        ^
        /home/smarchi/src/binutils-gdb/gdb/dwarf2/cooked-index.h:225:16: note: move assignment operator of 'cooked_index' is implicitly deleted because field 'm_storage' has a deleted move assignment operator
          auto_obstack m_storage;
                       ^
        /home/smarchi/src/binutils-gdb/gdb/../gdbsupport/gdb_obstack.h:128:3: note: 'operator=' has been explicitly marked deleted here
          DISABLE_COPY_AND_ASSIGN (auto_obstack);
          ^
        /home/smarchi/src/binutils-gdb/gdb/../include/ansidecl.h:425:8: note: expanded from macro 'DISABLE_COPY_AND_ASSIGN'
          void operator= (const TYPE &) = delete
               ^
    
    We explicitly make cooked_index have a default move constructor and
    move assignment operator.  But it doesn't actually happen because
    cooked_index has a field of type auto_obstack, which isn't movable.
    We don't actually need cooked_index to be movable at the moment, so
    remove those lines.
    
    Change-Id: Ifc1fe3d7d67e3ae1a14363d6c1869936fe80b0a2

Diff:
---
 gdb/dwarf2/cooked-index.h | 2 --
 1 file changed, 2 deletions(-)

diff --git a/gdb/dwarf2/cooked-index.h b/gdb/dwarf2/cooked-index.h
index 661664d9f84..4b52eaf93d0 100644
--- a/gdb/dwarf2/cooked-index.h
+++ b/gdb/dwarf2/cooked-index.h
@@ -169,9 +169,7 @@ class cooked_index
 {
 public:
   cooked_index () = default;
-  explicit cooked_index (cooked_index &&other) = default;
   DISABLE_COPY_AND_ASSIGN (cooked_index);
-  cooked_index &operator= (cooked_index &&other) = default;
 
   /* Create a new cooked_index_entry and register it with this object.
      Entries are owned by this object.  The new item is returned.  */


                 reply	other threads:[~2022-04-14 15:32 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=20220414153239.187B33857342@sourceware.org \
    --to=simark@sourceware.org \
    --cc=gdb-cvs@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).