libstdc++: Improve test for views::reverse

libstdc++-v3/ChangeLog:

	* testsuite/std/ranges/adaptors/reverse.cc: Replace duplicated
	line with a check that uses the const being/end overloads.
This commit is contained in:
Jonathan Wakely 2021-03-23 18:22:18 +00:00
parent 1959955104
commit d1aa5f57db

View File

@ -141,11 +141,12 @@ namespace test_ns
void test06()
{
// Check that views::reverse works and does not use ADL which could lead
// to accidentally finding test_ns::make_reverse_iterator(const A&).
// to accidentally finding test_ns::make_reverse_iterator(A*).
test_ns::A as[] = {{}, {}};
auto v = as | std::views::reverse;
static_assert(std::ranges::view<decltype(v)>);
static_assert(std::ranges::view<decltype(v)>);
using V = decltype(v);
static_assert( std::ranges::view<V> );
static_assert( std::ranges::range<const V> );
}
int