From d37c29f94234b8b62334f895b69c992bea6a6f10 Mon Sep 17 00:00:00 2001 From: Edward Smith-Rowland <3dw4rd@verizon.net> Date: Tue, 11 Jun 2019 16:29:35 +0000 Subject: [PATCH] Fix ConstexprIterator requirements tests - No constexpr algorithms! 2019-06-09 Edward Smith-Rowland <3dw4rd@verizon.net> Fix ConstexprIterator requirements tests - No constexpr algorithms! * testsuite/21_strings/basic_string_view/requirements/constexpr_iter.cc: Replace copy with hand-rolled loop. * testsuite/23_containers/array/requirements/constexpr_iter.cc: Ditto. From-SVN: r272159 --- libstdc++-v3/ChangeLog | 8 ++++++++ .../basic_string_view/requirements/constexpr_iter.cc | 6 +++++- .../23_containers/array/requirements/constexpr_iter.cc | 6 +++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 0abbaa92c93..c758643fe8e 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,11 @@ +2019-06-09 Edward Smith-Rowland <3dw4rd@verizon.net> + + Fix ConstexprIterator requirements tests - No constexpr algorithms! + * testsuite/21_strings/basic_string_view/requirements/constexpr_iter.cc: + Replace copy with hand-rolled loop. + * testsuite/23_containers/array/requirements/constexpr_iter.cc: + Ditto. + 2019-06-08 Edward Smith-Rowland <3dw4rd@verizon.net> Test for C++20 p0858 - ConstexprIterator requirements. diff --git a/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/constexpr_iter.cc b/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/constexpr_iter.cc index 24ab502372a..799fb0391f5 100644 --- a/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/constexpr_iter.cc +++ b/libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/constexpr_iter.cc @@ -30,7 +30,11 @@ test() static_assert('W' == *(hw.cbegin() + 7)); std::array a2{{0,0,0,0,0,0,0,0,0,0,0,0,0}}; - std::copy(hw.begin(), hw.end(), a2.begin()); + auto hwi = hw.begin(); + auto hwe = hw.end(); + auto a2i = a2.begin(); + while (hwi != hwe) + *a2i++ = *hwi++; return *(hw.cbegin() + 3); } diff --git a/libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_iter.cc b/libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_iter.cc index 88d69d2f8c7..208078c3b5a 100644 --- a/libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_iter.cc +++ b/libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_iter.cc @@ -29,7 +29,11 @@ test() static_assert(1 == *a1.cbegin()); std::array a2{{0, 0, 0}}; - std::copy(a1.begin(), a1.end(), a2.begin()); + auto a1i = a1.begin(); + auto a1e = a1.end(); + auto a2i = a2.begin(); + while (a1i != a1e) + *a2i++ = *a1i++; return n; } -- 2.30.2