public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Patrick Palka <ppalka@redhat.com>
Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] libstdc++: Remove overzealous static_asserts from std::span
Date: Mon, 21 Sep 2020 22:17:30 +0100	[thread overview]
Message-ID: <20200921211730.GO6061@redhat.com> (raw)
In-Reply-To: <521c85f-5911-b97-e097-203d452350c0@idea>

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.



      reply	other threads:[~2020-09-21 21:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-21 18:45 Patrick Palka
2020-09-21 19:07 ` Patrick Palka
2020-09-21 21:17   ` Jonathan Wakely [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200921211730.GO6061@redhat.com \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=libstdc++@gcc.gnu.org \
    --cc=ppalka@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).