diff options
Diffstat (limited to 'libstdc++-v3/testsuite/std/ranges')
-rw-r--r-- | libstdc++-v3/testsuite/std/ranges/zip/1.cc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/libstdc++-v3/testsuite/std/ranges/zip/1.cc b/libstdc++-v3/testsuite/std/ranges/zip/1.cc index b7717ae..ea4274d 100644 --- a/libstdc++-v3/testsuite/std/ranges/zip/1.cc +++ b/libstdc++-v3/testsuite/std/ranges/zip/1.cc @@ -41,8 +41,8 @@ test01() VERIFY( i2 == z2.end() ); VERIFY( ranges::size(z2) == 2 ); VERIFY( ranges::size(std::as_const(z2)) == 2 ); - VERIFY( z2[0].first == 1 && z2[0].second == 3 ); - VERIFY( z2[1].first == 2 && z2[1].second == 4 ); + VERIFY( std::get<0>(z2[0]) == 1 && std::get<1>(z2[0]) == 3 ); + VERIFY( std::get<0>(z2[1]) == 2 && std::get<1>(z2[1]) == 4 ); for (const auto [x, y] : z2) { VERIFY( y - x == 2 ); @@ -124,6 +124,18 @@ test04() return true; } +constexpr bool +test05() +{ + // PR libstdc++/109203 + int x[] = {1, 1, 2}; + int y[] = {2, 1, 3}; + auto r = views::zip(x, y); + ranges::sort(r); + + return true; +} + int main() { @@ -131,4 +143,5 @@ main() static_assert(test02()); static_assert(test03()); static_assert(test04()); + static_assert(test05()); } |