libstdc++: Fix bug in std::span test

The previous commit fixed the std::span constructors from const arrays,
revealing a bug in this test.

	* testsuite/23_containers/span/lwg3255.cc: Fix test. Constructing a
	span of non-const elements should not be possible from a const array
	or an array of const elements.

From-SVN: r279001
This commit is contained in:
Jonathan Wakely 2019-12-05 13:50:08 +00:00 committed by Jonathan Wakely
parent a7922ddf48
commit 5a784d350c
2 changed files with 13 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2019-12-05 Jonathan Wakely <jwakely@redhat.com>
* testsuite/23_containers/span/lwg3255.cc: Fix test. Constructing a
span of non-const elements should not be possible from a const array
or an array of const elements.
2019-12-05 JeanHeyd "ThePhD" Meneide <phdofthehouse@gmail.com>
Implement P1872R0 and P1394R0 for std::span

View File

@ -39,7 +39,6 @@ static_assert( is_constructible_v<span<int, 1>, array<int, 1>&> );
static_assert( is_constructible_v<span<const int, 1>, array<int, 1>&> );
static_assert( is_constructible_v<span<const int, 1>, array<const int, 1>&> );
static_assert( is_constructible_v<span<int, 1>, const array<int, 1>&> );
static_assert( is_constructible_v<span<const int, 1>, const array<int, 1>&> );
static_assert( is_constructible_v<span<const int, 1>, const array<const int, 1>&> );
@ -63,6 +62,12 @@ static_assert( is_constructible_v<span<int>, array<int, 2>&> );
static_assert( is_constructible_v<span<const int>, array<int, 2>&> );
static_assert( is_constructible_v<span<const int>, array<const int, 2>&> );
static_assert( is_constructible_v<span<int>, const array<int, 2>&> );
static_assert( is_constructible_v<span<const int>, const array<int, 2>&> );
static_assert( is_constructible_v<span<const int>, const array<const int, 2>&> );
static_assert( ! is_constructible_v<span<int, 1>, array<const int, 1>&> );
static_assert( ! is_constructible_v<span<int, 1>, const array<int, 1>&> );
static_assert( ! is_constructible_v<span<int, 1>, const array<const int, 1>&> );
static_assert( ! is_constructible_v<span<int>, array<const int, 2>&> );
static_assert( ! is_constructible_v<span<int>, const array<int, 2>&> );
static_assert( ! is_constructible_v<span<int>, const array<const int, 2>&> );