mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-10 09:20:31 +08:00
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
This commit is contained in:
parent
9adfa8e25f
commit
d37c29f942
@ -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.
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user