From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by sourceware.org (Postfix) with ESMTPS id D2271385735D for ; Thu, 14 Apr 2022 15:22:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D2271385735D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f50.google.com with SMTP id u3so7411658wrg.3 for ; Thu, 14 Apr 2022 08:22:50 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:references:from:in-reply-to :content-transfer-encoding; bh=DSw7a+2hg1B3qNkTNV3UanJtfGqSTxZDHeaOHG9zuh4=; b=Wd9qGeFrv/qOSkX1P+SMdYR0N2cxo6W3GSXinZyws4D5POAHojuT0iBk97xcZZ3p/6 U730wJa/Futc7gW8CZop6QFR3M669kDvLGK/VLrGBleOXNgZHz4+SCWlSgpzyLg2kVKa 8rrAOJ4bmWsbCOws5Hghzmvhh5mkgOPe1N8Wuq+wguWPWNwHZ9F7V5Gy5BQRV06tWNjo LlsFlWSH20wpURpvV5JC4CQlAXBugxNvB+0+IEvV8rvCIqsBH1tsrA2YtM0dw9wyWajL 3Ir5Swn8Why9v5q9jde/TUqRoNQ8Q3bviAg92SXczp1DSVwf1llkQXvNYk8Hdsh6LNio LnCA== X-Gm-Message-State: AOAM531Z/GUgWkr7fKivfcQxSjfd4HeHzq0vZVZyONw9wxeF65oDFLRT fL0/OKFQU/tlKSwRJ/k2MnlzxsS74SWWLQ== X-Google-Smtp-Source: ABdhPJzBz0qHDGxhqRqFNgzAexRwZX6iTsCP6MYuSXQ/Xso24FbFOw1u0Ux+UMCw7ylJhpKvh6OhmQ== X-Received: by 2002:a5d:4cce:0:b0:207:a1f1:6f50 with SMTP id c14-20020a5d4cce000000b00207a1f16f50mr2393617wrt.139.1649949769704; Thu, 14 Apr 2022 08:22:49 -0700 (PDT) Received: from ?IPV6:2001:8a0:f924:2600:209d:85e2:409e:8726? ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id k20-20020a05600c1c9400b0038ecd1ccc17sm6232315wms.35.2022.04.14.08.22.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 14 Apr 2022 08:22:48 -0700 (PDT) Message-ID: Date: Thu, 14 Apr 2022 16:22:47 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: Re: [PATCH] gdbsupport: implement move constructor and assignment operator in auto_obstack Content-Language: en-US To: Simon Marchi , Simon Marchi , gdb-patches@sourceware.org References: <20220413185920.536018-1-simon.marchi@efficios.com> From: Pedro Alves In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Apr 2022 15:22:52 -0000 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. 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.