Fix ConstexprIterator requirements tests - No constexpr algorithms!
authorEdward Smith-Rowland <3dw4rd@verizon.net>
Tue, 11 Jun 2019 16:29:35 +0000 (16:29 +0000)
committerEdward Smith-Rowland <emsr@gcc.gnu.org>
Tue, 11 Jun 2019 16:29:35 +0000 (16:29 +0000)
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
libstdc++-v3/testsuite/21_strings/basic_string_view/requirements/constexpr_iter.cc
libstdc++-v3/testsuite/23_containers/array/requirements/constexpr_iter.cc

index 0abbaa92c93d9bf6bda7258fd3dd25275b364bd3..c758643fe8ed2087dddd5ee1be81d11b8549d599 100644 (file)
@@ -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.
index 24ab502372a85135abcac2adf9a6d5da57cc820d..799fb0391f5a4b81278aaaaedfa58612ca8b910b 100644 (file)
@@ -30,7 +30,11 @@ test()
   static_assert('W' == *(hw.cbegin() + 7));
 
   std::array<int, hw.size()> 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);
 }
index 88d69d2f8c7fff077576a4f823b29d7bb358f230..208078c3b5aa86d914eed1daaf09fe88e0afdad7 100644 (file)
@@ -29,7 +29,11 @@ test()
   static_assert(1 == *a1.cbegin());
 
   std::array<int, 3> 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;
 }