public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: Pedro Alves <pedro@palves.net>,
	Simon Marchi <simon.marchi@efficios.com>,
	 gdb-patches@sourceware.org
Subject: Re: [PATCH] gdbsupport: implement move constructor and assignment operator in auto_obstack
Date: Thu, 14 Apr 2022 11:32:59 -0400	[thread overview]
Message-ID: <b3dd25bf-e9a1-7b58-2dea-de61e027fd63@polymtl.ca> (raw)
In-Reply-To: <f4031f84-cdc6-04df-8567-c8cb7d9004cc@palves.net>



On 2022-04-14 11:22, Pedro Alves wrote:
> On 2022-04-14 16:12, Simon Marchi wrote:
>>> The patch looks fine if we really want to make auto_obstack movable, but,
>>> stepping back a bit, does cooked_index really need or want to be movable?
>>> I did this, here:
>>>
>>> diff --git c/gdb/dwarf2/cooked-index.h w/gdb/dwarf2/cooked-index.h
>>> index 661664d9f84..e3d8b5a59b7 100644
>>> --- c/gdb/dwarf2/cooked-index.h
>>> +++ w/gdb/dwarf2/cooked-index.h
>>> @@ -169,9 +169,9 @@ class cooked_index
>>>  {
>>>  public:
>>>    cooked_index () = default;
>>> -  explicit cooked_index (cooked_index &&other) = default;
>>> +  explicit cooked_index (cooked_index &&other) = delete;
>>>    DISABLE_COPY_AND_ASSIGN (cooked_index);
>>> -  cooked_index &operator= (cooked_index &&other) = default;
>>> +  cooked_index &operator= (cooked_index &&other) = delete;
>>>
>>> and gdb still built.
>>
>> Hmm, I saw that do an std::move of a cooked_index_vector, so I thought
>> we did move cooked_indexes.  But actually it is a vector of
>> unique_ptr<cooked_index>.  And I guess that since auto_obstack is
>> non-copyable and non-movable, it wouldn't build today if we really tried
>> to copy or move a cooked_index.
>>
>> We can just delete those lines then (instead of making them explicitly
>> deleted), just having DISABLE_COPY_AND_ASSIGN is enough.
> 
> Please go ahead.

Done, thanks.

simon

      reply	other threads:[~2022-04-14 15:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-13 18:59 Simon Marchi
2022-04-14 14:52 ` Pedro Alves
2022-04-14 15:12   ` Simon Marchi
2022-04-14 15:22     ` Pedro Alves
2022-04-14 15:32       ` Simon Marchi [this message]

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=b3dd25bf-e9a1-7b58-2dea-de61e027fd63@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=pedro@palves.net \
    --cc=simon.marchi@efficios.com \
    /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).