From patchwork Tue Oct 15 14:20:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 1997501 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=OTatYWdM; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4XSbzc2Phtz1xv6 for ; Wed, 16 Oct 2024 01:27:55 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id A9CC93858C53 for ; Tue, 15 Oct 2024 14:27:52 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id 6A0703858C51 for ; Tue, 15 Oct 2024 14:26:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6A0703858C51 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6A0703858C51 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729002415; cv=none; b=ELwS1BSGf679uI+kztedJtTIVNJ52Mvg9x/1o8p0arGUr/eBRYBhCLadSJ29HcKAchLRSL1MixAnUD7JEA4YEBuRLuWPYFHo7cJxJhELpN+dmx9kBgwrxBd9B7S4qeTbO6go+nd6LEvCnQyIFWS6gjo/nfe8t6IbhB/vOImUNWc= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1729002415; c=relaxed/simple; bh=+Jea2MESp+NCgX7MAyxLtRf7urtJA49qTb7A66xNaU4=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=TEXY37DQhFESkuq7GVgefVUzl2J00lqx3xxjlCPLfTSskSSI8JDS/XKo2asYNSRh41BQPdqglCbOynizEutS86oPU6phU31xWSwi8WlTwNb7irPnvz5gteaxTkUF6LKZp5a53hfGgfuk4bW25OnU0KsY/o3uhIBAq09CXF1O0hg= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1729002406; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GTtivYDWocmgMIWnE+nQa1lKVzDd/AZFIWqaEVQSWno=; b=OTatYWdM8Fx4K8IyZX1Gd+ReP76LKttQt5iWGfKm4+accCCj2tBEZiUgHkjiOdaIovVKLD 4UaRNrq0uAiZCdpuxdbX7jiliIs46qHYnfEgrdo+PKkbtnM7NYJE4PR5d5x5kA9UR/gSPK aeTgE6CYHoKT+O+SN+otjxQ32O7KbnI= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-569-bMujs257P4W4g-dbQJpYlg-1; Tue, 15 Oct 2024 10:26:44 -0400 X-MC-Unique: bMujs257P4W4g-dbQJpYlg-1 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (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 mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id C8F621955F28; Tue, 15 Oct 2024 14:26:43 +0000 (UTC) Received: from localhost (unknown [10.42.28.16]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 342AA1956089; Tue, 15 Oct 2024 14:26:43 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [PATCH 5/7] libstdc++: Add nodiscard to std::find Date: Tue, 15 Oct 2024 15:20:15 +0100 Message-ID: <20241015142630.2148792-5-jwakely@redhat.com> In-Reply-To: <20241015142630.2148792-1-jwakely@redhat.com> References: <20241015142630.2148792-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Tested x86_64-linux. -- >8 -- libstdc++-v3/ChangeLog: * include/bits/stl_algobase.h (find): Add nodiscard. --- libstdc++-v3/include/bits/stl_algobase.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/include/bits/stl_algobase.h b/libstdc++-v3/include/bits/stl_algobase.h index 34e1cf7322f..d9d1d00b113 100644 --- a/libstdc++-v3/include/bits/stl_algobase.h +++ b/libstdc++-v3/include/bits/stl_algobase.h @@ -2087,7 +2087,7 @@ _GLIBCXX_BEGIN_NAMESPACE_ALGO * such that @c *i == @p __val, or @p __last if no such iterator exists. */ template - _GLIBCXX20_CONSTEXPR + _GLIBCXX_NODISCARD _GLIBCXX20_CONSTEXPR inline _InputIterator find(_InputIterator __first, _InputIterator __last, const _Tp& __val) {