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 [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 6BBA3386EC6A for ; Mon, 21 Sep 2020 21:17:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6BBA3386EC6A 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-153-Dmgyf1bGPOCFIytci1aaoQ-1; Mon, 21 Sep 2020 17:17:33 -0400 X-MC-Unique: Dmgyf1bGPOCFIytci1aaoQ-1 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 086CD1868404; Mon, 21 Sep 2020 21:17:32 +0000 (UTC) Received: from localhost (unknown [10.33.36.46]) by smtp.corp.redhat.com (Postfix) with ESMTP id 9739578808; Mon, 21 Sep 2020 21:17:31 +0000 (UTC) Date: Mon, 21 Sep 2020 22:17:30 +0100 From: Jonathan Wakely To: Patrick Palka Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: Re: [PATCH] libstdc++: Remove overzealous static_asserts from std::span Message-ID: <20200921211730.GO6061@redhat.com> References: <20200921184533.3909335-1-ppalka@redhat.com> <521c85f-5911-b97-e097-203d452350c0@idea> MIME-Version: 1.0 In-Reply-To: <521c85f-5911-b97-e097-203d452350c0@idea> X-Clacks-Overhead: GNU Terry Pratchett X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 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=-5.5 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=unavailable autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2020 21:17:37 -0000 On 21/09/20 15:07 -0400, Patrick Palka via Libstdc++ wrote: >On Mon, 21 Sep 2020, Patrick Palka wrote: > >> For a span with empty static extent, we currently model the >> preconditions of front(), back(), and operator[] as if they were >> mandates, by using a static_assert to verify that extent != 0. This >> causes us to incorrectly reject valid programs that instantiate these >> member functions but never call them. >> >> libstdc++-v3/ChangeLog: >> >> * include/std/span (span::front): Remove static_assert. >> (span::back): Likewise. >> (span::operator[]): Likewise. >> * testsuite/23_containers/span/back_neg.cc: Remove. >> * testsuite/23_containers/span/front_neg.cc: Remove. >> * testsuite/23_containers/span/index_op_neg.cc: Remove. > >Here's a version that rewrites rather than removes the testcases: OK fortrunk, thanks. We might want to backport this too.