On 05/12/19 13:49 +0000, Jonathan Wakely wrote:
This also causes two new FAILs in 23_containers/span/lwg3255.cc but that turns out to be a bug in the test, which fails now t hat you've fixed a bug in span. I'll fix that as well.
Here's that fix for the buggy test. Tested powerpc64le-linux, committed to trunk as attached.
commit 2a392014c8f474492be34f73fb0f1a6efb56aa70 Author: Jonathan Wakely <jwak...@redhat.com> Date: Thu Dec 5 13:37:54 2019 +0000 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. diff --git a/libstdc++-v3/testsuite/23_containers/span/lwg3255.cc b/libstdc++-v3/testsuite/23_containers/span/lwg3255.cc index bab7da3bf19..eec686b4ea2 100644 --- a/libstdc++-v3/testsuite/23_containers/span/lwg3255.cc +++ b/libstdc++-v3/testsuite/23_containers/span/lwg3255.cc @@ -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>&> );