Re: Enable string_view assertions

2018-03-16 Thread Jonathan Wakely
On 15 March 2018 at 00:18, Jonathan Wakely wrote: > On 14 March 2018 at 23:27, Jonathan Wakely wrote: >> Here's one way to generalize this idea. We could potentially replace >> most of the lightweight __glibcxx_assert checks with this, to get >> zero-overhead static checking at compile-time wheneve

Re: Enable string_view assertions

2018-03-14 Thread Jonathan Wakely
On 14 March 2018 at 23:27, Jonathan Wakely wrote: > Here's one way to generalize this idea. We could potentially replace > most of the lightweight __glibcxx_assert checks with this, to get > zero-overhead static checking at compile-time whenever possible (even > in constexpr functions) and have opt

Re: Enable string_view assertions

2018-03-14 Thread Jonathan Wakely
On 14 March 2018 at 22:52, Jonathan Wakely wrote: > (Resending from a different account, sorry for the duplicate). > > On 14/03/18 22:12 +0100, François Dumont wrote: >> constexpr const _CharT& >> operator[](size_type __pos) const noexcept >> { >>- // TODO: Assert to restore

Re: Enable string_view assertions

2018-03-14 Thread Jonathan Wakely
(Resending from a different account, sorry for the duplicate). On 14/03/18 22:12 +0100, François Dumont wrote: > constexpr const _CharT& > operator[](size_type __pos) const noexcept > { >- // TODO: Assert to restore in a way compatible with the constexpr. >- // __glibcx

Enable string_view assertions

2018-03-14 Thread François Dumont
Hi     Following PR 78420 patch I realized that we can use similar technique to have assertions in string_view implementations.     I also rename testsuite files expected to XFAIL as they should have a trailing '_neg'. It fixes 4 XPASS when run in debug mode     Note that I also try to use