From: Jonathan Wakely Date: Thu, 5 Dec 2019 13:50:08 +0000 (+0000) Subject: libstdc++: Fix bug in std::span test X-Git-Tag: misc/cutover-git~721 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5a784d350c57d670775471bec847370ed7677666;p=thirdparty%2Fgcc.git 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 --- diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 82cb5a994000..b041bb4e3ed7 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,9 @@ +2019-12-05 Jonathan Wakely + + * 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 Implement P1872R0 and P1394R0 for std::span diff --git a/libstdc++-v3/testsuite/23_containers/span/lwg3255.cc b/libstdc++-v3/testsuite/23_containers/span/lwg3255.cc index bab7da3bf19f..eec686b4ea2d 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, array&> ); static_assert( is_constructible_v, array&> ); static_assert( is_constructible_v, array&> ); -static_assert( is_constructible_v, const array&> ); static_assert( is_constructible_v, const array&> ); static_assert( is_constructible_v, const array&> ); @@ -63,6 +62,12 @@ static_assert( is_constructible_v, array&> ); static_assert( is_constructible_v, array&> ); static_assert( is_constructible_v, array&> ); -static_assert( is_constructible_v, const array&> ); static_assert( is_constructible_v, const array&> ); static_assert( is_constructible_v, const array&> ); + +static_assert( ! is_constructible_v, array&> ); +static_assert( ! is_constructible_v, const array&> ); +static_assert( ! is_constructible_v, const array&> ); +static_assert( ! is_constructible_v, array&> ); +static_assert( ! is_constructible_v, const array&> ); +static_assert( ! is_constructible_v, const array&> );