From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id BE095393F82B for ; Wed, 4 Aug 2021 12:00:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BE095393F82B Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-126-oDd5mA22NL-gWVhOnPMWsQ-1; Wed, 04 Aug 2021 08:00:16 -0400 X-MC-Unique: oDd5mA22NL-gWVhOnPMWsQ-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 68742801AC0; Wed, 4 Aug 2021 12:00:15 +0000 (UTC) Received: from localhost (unknown [10.33.36.118]) by smtp.corp.redhat.com (Postfix) with ESMTP id 16AA460C0F; Wed, 4 Aug 2021 12:00:14 +0000 (UTC) Date: Wed, 4 Aug 2021 13:00:14 +0100 From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [committed 2/2] libstdc++: Add [[nodiscard]] to sequence containers Message-ID: References: MIME-Version: 1.0 In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP 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: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Aug 2021 12:00:19 -0000 On 04/08/21 12:56 +0100, Jonathan Wakely wrote: >... and container adaptors. > >This adds the [[nodiscard]] attribute to functions with no side-effects >for the sequence containers and their iterators, and the debug versions >of those containers, and the container adaptors, I don't plan to add any more [[nodiscard]] attributes for now, but these two commits should demonstrate how to do it for anybody who wants to contribute similar patches. I didn't add tests that verify we do actually warn on each of those functions, because there are hundreds of them, and I know they're working because I had to alter existing tests to not warn.