From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id iStNARYJAmCvSgAAWB0awg (envelope-from ) for ; Fri, 15 Jan 2021 16:28:54 -0500 Received: by simark.ca (Postfix, from userid 112) id EB01F1E945; Fri, 15 Jan 2021 16:28:53 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 95B101E945 for ; Fri, 15 Jan 2021 16:28:53 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 68D4A385482F; Fri, 15 Jan 2021 21:28:52 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 68D4A385482F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1610746132; bh=7Q/WRCCaRwIGkLsL/achvSy7dNDsnHEKorZp550jgtM=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=bvE8tyWhVqFbIRog2/c2fLMbDdJlDc9k5lLxRrOb4s3XpGy3RJ9bLAb+emn8NhOBq wu/lneAw1AqK4z583mbkM5lb6os0PcqMVYPFGEwf8l/3L2kVq0tJ+7OO1IIzMg3Jw3 06cFcjItosocHnsgJxmzFzKm828PR7DmswkN9Z8k= Received: from beryx.lancelotsix.com (beryx.lancelotsix.com [IPv6:2001:41d0:401:3000::1ab3]) by sourceware.org (Postfix) with ESMTPS id 7D9743857033 for ; Fri, 15 Jan 2021 21:28:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7D9743857033 Received: from Plymouth.lan (unknown [IPv6:2a02:390:8443:0:cdf3:9065:681d:ebc4]) by beryx.lancelotsix.com (Postfix) with ESMTPSA id 5A3DD2E071; Fri, 15 Jan 2021 22:28:48 +0100 (CET) To: gdb-patches@sourceware.org Subject: [PATCH v2] use DISABLE_COPY_AND_ASSIGN in switch_thru_all_uis Date: Fri, 15 Jan 2021 21:28:42 +0000 Message-Id: <20210115212842.24317-1-lsix@lancelotsix.com> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210115194950.16882-1-lsix@lancelotsix.com> References: <20210115194950.16882-1-lsix@lancelotsix.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.11 (beryx.lancelotsix.com [0.0.0.0]); Fri, 15 Jan 2021 22:28:48 +0100 (CET) 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: , From: Lancelot SIX via Gdb-patches Reply-To: Lancelot SIX Cc: Lancelot SIX Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" In switch_thru_all_uis, a pre-c++11 way of removing copy constructor and assignment operator is used. This patch uses the DISABLE_COPY_AND_ASSIGN macro which does the right thing for pre and post c++11. gdb/Changelog: * top.h (switch_thru_all_uis): Use DISABLE_COPY_AND_ASSIGN. --- gdb/top.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/gdb/top.h b/gdb/top.h index a31b19ae954..f58bebbb385 100644 --- a/gdb/top.h +++ b/gdb/top.h @@ -173,6 +173,8 @@ class switch_thru_all_uis current_ui = ui_list; } + DISABLE_COPY_AND_ASSIGN (switch_thru_all_uis); + /* If done iterating, return true; otherwise return false. */ bool done () const { @@ -190,11 +192,6 @@ class switch_thru_all_uis private: - /* No need for these. They are intentionally not defined - anywhere. */ - switch_thru_all_uis &operator= (const switch_thru_all_uis &); - switch_thru_all_uis (const switch_thru_all_uis &); - /* Used to iterate through the UIs. */ struct ui *m_iter; -- 2.29.2