]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Fix ConstexprIterator requirements tests - No constexpr algorithms!
authorEdward Smith-Rowland <3dw4rd@verizon.net>
Tue, 11 Jun 2019 16:36:21 +0000 (16:36 +0000)
committerEdward Smith-Rowland <emsr@gcc.gnu.org>
Tue, 11 Jun 2019 16:36:21 +0000 (16:36 +0000)
2019-06-11  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: r272160

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 8d3a5c5ef0c79fb87b2447a68b98077f47e319aa..9caebc460a05baef9f1924378ec88c1e46659d46 100644 (file)
@@ -1,3 +1,19 @@
+2019-06-11  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-09  Edward Smith-Rowland  <3dw4rd@verizon.net>
+
+        Test for C++20 p0858 - ConstexprIterator requirements.
+        * testsuite/21_strings/basic_string_view/requirements/constexpr_iter.cc:
+        New test.
+        * testsuite/23_containers/array/requirements/constexpr_iter.cc:
+        New test.
+
 2019-06-05  Jakub Jelinek  <jakub@redhat.com>
 
        Backported from mainline
index 9b179e2c5341163869c7b4f95a623280d041da28..799fb0391f5a4b81278aaaaedfa58612ca8b910b 100644 (file)
@@ -29,6 +29,13 @@ test()
   auto ch = hw[4];
   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}};
+  auto hwi = hw.begin();
+  auto hwe = hw.end();
+  auto a2i = a2.begin();
+  while (hwi != hwe)
+    *a2i++ = *hwi++;
+
   return *(hw.cbegin() + 3);
 }
 
index 559153f33d9063500bd1a16eb459ccf9a7d28883..208078c3b5aa86d914eed1daaf09fe88e0afdad7 100644 (file)
@@ -28,6 +28,13 @@ test()
   auto n = a1[0] * a1[1]* a1[2];
   static_assert(1 == *a1.cbegin());
 
+  std::array<int, 3> a2{{0, 0, 0}};
+  auto a1i = a1.begin();
+  auto a1e = a1.end();
+  auto a2i = a2.begin();
+  while (a1i != a1e)
+    *a2i++ = *a1i++;
+
   return n;
 }