diff --git a/libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp b/libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp --- a/libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp +++ b/libcxx/test/std/ranges/range.utility/view.interface/view.interface.pass.cpp @@ -15,6 +15,7 @@ #include #include +#include #include "test_macros.h" #include "test_iterators.h" @@ -233,17 +234,20 @@ static_assert(!SizeInvocable); static_assert( SizeInvocable); - using SignedSize = std::common_type_t>; + // Test the test. + static_assert(std::same_as() - std::declval()), std::ptrdiff_t>); + using UnsignedSize = std::make_unsigned_t; + using SignedSize = std::common_type_t>; ForwardRange forwardRange; assert(forwardRange.size() == 8); assert(static_cast(forwardRange).size() == 8); assert(std::ranges::size(forwardRange) == 8); - static_assert(std::same_as())), std::size_t>); + static_assert(std::same_as())), UnsignedSize>); static_assert(std::same_as())), SignedSize>); assert(std::ranges::size(static_cast(forwardRange)) == 8); - static_assert(std::same_as())), std::size_t>); + static_assert(std::same_as())), UnsignedSize>); static_assert(std::same_as())), SignedSize>); SizeIsTen sizeTen;