c++: Fix ICE with #embed/RAW_DATA_CST after list conversion [PR118671]
[gcc.git] / libstdc++-v3 / testsuite / 25_algorithms / move / constexpr.cc
blobf678e104bd6f52e5217d100a708cbb002032c23b
1 // { dg-do compile { target c++20 } }
3 #include <algorithm>
4 #include <span>
6 constexpr bool
7 test01()
9 // PR libstdc++/102358
10 int x[2] = {1,2}, y[2];
11 std::span in(x), out(y);
12 std::move(std::move_iterator(in.begin()), std::move_iterator(in.end()),
13 out.begin());
14 return std::equal(std::move_iterator(in.begin()), std::move_iterator(in.end()),
15 std::move_iterator(out.begin()));
18 static_assert(test01());
20 constexpr bool
21 test02()
23 int x[2] = {1,2}, y[2];
24 std::span in(x), out(y);
25 std::move(in.rbegin(), in.rend(), out.rbegin());
26 return std::equal(in.rbegin(), in.rend(), out.rbegin());
29 static_assert(test02());