From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QCpoHTg4RWUb7D0AWB0awg (envelope-from ) for ; Fri, 03 Nov 2023 14:13:12 -0400 Authentication-Results: simark.ca; dkim=fail reason="signature verification failed" (768-bit key; unprotected) header.d=tromey.com header.i=@tromey.com header.a=rsa-sha256 header.s=default header.b=UKV8oMBy; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 6970E1E1A7; Fri, 3 Nov 2023 14:13:12 -0400 (EDT) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 2197B1E0D2 for ; Fri, 3 Nov 2023 14:13:10 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 67CA93858C2D for ; Fri, 3 Nov 2023 18:13:09 +0000 (GMT) Received: from omta38.uswest2.a.cloudfilter.net (omta38.uswest2.a.cloudfilter.net [35.89.44.37]) by sourceware.org (Postfix) with ESMTPS id D9AF33858D28 for ; Fri, 3 Nov 2023 18:12:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D9AF33858D28 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=tromey.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=tromey.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org D9AF33858D28 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=35.89.44.37 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699035178; cv=none; b=GA/4aicbl3ujy6KgH58nBb/p4XHH29icFKqyuA2bEmRTVc0KZAZaYmGTvhfZ7jdf5nngHp/YFCXlQM1fuGDlSrrUXjyJML+LgLxUNjHRU3oWOUTOKQbbbuGDzQHVpvOWZYYXgznR5ncbjJSj2cAXnV/j3jeTp1Qhp1LFW64o5RY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699035178; c=relaxed/simple; bh=KVccy1ZrnaGpys/db5fBQcvscTd+qfwkbBvNWp42YoY=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=pB8JBfv6PwyeoW6BfJmvbo3jZFTdsb8AbYTrVapGayjfRsiZbg8mmd3bWGz4X7S6NZJuEq+qIiT3DNzaTFjVlJ+nHQk8DucEKlmjr1S6JJ71PpZ5B8WSmocuXHQD5pLtDR9IgDWzJDrAJY8hRD6CkpP8tbVeXDNRsmj20gttB9E= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from eig-obgw-5005a.ext.cloudfilter.net ([10.0.29.234]) by cmsmtp with ESMTPS id yoA1qmT5FKOkLyyf0q9nPM; Fri, 03 Nov 2023 18:12:47 +0000 Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with ESMTPS id yyezqXazUTiJWyyf0qOzff; Fri, 03 Nov 2023 18:12:46 +0000 X-Authority-Analysis: v=2.4 cv=IpgNzZzg c=1 sm=1 tr=0 ts=6545381e a=ApxJNpeYhEAb1aAlGBBbmA==:117 a=ApxJNpeYhEAb1aAlGBBbmA==:17 a=OWjo9vPv0XrRhIrVQ50Ab3nP57M=:19 a=dLZJa+xiwSxG16/P+YVxDGlgEgI=:19 a=BNY50KLci1gA:10 a=Qbun_eYptAEA:10 a=_ZhYKdCeAAAA:8 a=zstS-IiYAAAA:8 a=g5gbRMOKBL_KPpDIR9EA:9 a=zgiPjhLxNE0A:10 a=uqOk3ZSnBfCTOznnrPA1:22 a=4G6NA9xxw8l3yy4pmD5M:22 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:References :Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=vzUnyWv3eT2jIAynmysY/Yi2mL+9XUYWY9ppffZMe28=; b=UKV8oMByExMdy/E4ZMXt8vBGws KA9D1RMvUfNyVlYrG1YhOK1tTXvcpoKQztFWNyuxbLJ08G0/U2SqrvjZSMbnjX8XKH+QI5urI6bqE 0EwP7r/R+c9t+Fy57sAq6EPYC; Received: from 97-122-77-73.hlrn.qwest.net ([97.122.77.73]:54574 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96.2) (envelope-from ) id 1qyyez-0009F9-1Y; Fri, 03 Nov 2023 12:12:45 -0600 From: Tom Tromey To: Simon Marchi Cc: gdb-patches@sourceware.org, Simon Marchi Subject: Re: [PATCH] gdbsupport: mark array_view::slice with [[nodiscard]] References: <20231103031917.927026-1-simon.marchi@polymtl.ca> X-Attribution: Tom Date: Fri, 03 Nov 2023 12:12:44 -0600 In-Reply-To: <20231103031917.927026-1-simon.marchi@polymtl.ca> (Simon Marchi's message of "Thu, 2 Nov 2023 23:19:09 -0400") Message-ID: <87y1feiu3n.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - box5379.bluehost.com X-AntiAbuse: Original Domain - sourceware.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tromey.com X-BWhitelist: no X-Source-IP: 97.122.77.73 X-Source-L: No X-Exim-ID: 1qyyez-0009F9-1Y X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 97-122-77-73.hlrn.qwest.net (murgatroyd) [97.122.77.73]:54574 X-Source-Auth: tom+tromey.com X-Email-Count: 2 X-Org: HG=bhshared;ORG=bluehost; X-Source-Cap: ZWx5bnJvYmk7ZWx5bnJvYmk7Ym94NTM3OS5ibHVlaG9zdC5jb20= X-Local-Domain: yes X-CMAE-Envelope: MS4xfP1dgemMNXA0fiRF6R7mzcHBdH9dTeKqS1vmSvyGKcHGYR0JpUhuhzDbjJh8rTezv3VQFWpJoVp9x1QHnQTBPfb3BYt3lGkyF6YBGu+nhAbxi/JRm4eN iaBNfaKkP83anvHpiv/TKQND+BTPoh/jr1z14Ybmp0pvIINvOOOf4ZB5CRhADJzVcYpxHkUQBxH4O5pJlfknjUKhNQsVim3eB8g= X-Spam-Status: No, score=-3018.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, JMQ_SPF_NEUTRAL, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org >>>>> "Simon" == Simon Marchi writes: Simon> The first one does nothing, it creates a new array_view but without Simon> using it, it's useless. Mark the slice methods with [[nodiscard]] Simon> (which is standard C++17) so that error would generate a warning. Looks good to me. Unfortunately std::span::subspan doesn't seem to have this annotation. I wonder if it could be added. Approved-By: Tom Tromey Tom