diff --git a/libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_iterator.compile.pass.cpp b/libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_iterator.compile.pass.cpp index 9f1076d079c6..8567cf2dc926 100644 --- a/libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_iterator.compile.pass.cpp +++ b/libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_iterator.compile.pass.cpp @@ -29,3 +29,10 @@ struct ForwardProxyIterator { static_assert(std::ranges::__nothrow_forward_iterator>); static_assert(std::forward_iterator); static_assert(!std::ranges::__nothrow_forward_iterator); + +constexpr bool forward_subsumes_input(std::ranges::__nothrow_forward_iterator auto) { + return true; +} +constexpr bool forward_subsumes_input(std::ranges::__nothrow_input_iterator auto); + +static_assert(forward_subsumes_input("foo")); diff --git a/libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_range.compile.pass.cpp b/libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_range.compile.pass.cpp index ba2889803501..2510c729f2bf 100644 --- a/libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_range.compile.pass.cpp +++ b/libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_forward_range.compile.pass.cpp @@ -33,3 +33,10 @@ static_assert(std::ranges::__nothrow_forward_range> static_assert(!std::ranges::__nothrow_forward_range>); static_assert(std::ranges::forward_range>); static_assert(!std::ranges::__nothrow_forward_range>); + +constexpr bool forward_subsumes_input(std::ranges::__nothrow_forward_range auto&&) { + return true; +} +constexpr bool forward_subsumes_input(std::ranges::__nothrow_input_range auto&&); + +static_assert(forward_subsumes_input("foo")); diff --git a/libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_sentinel_for.compile.pass.cpp b/libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_sentinel_for.compile.pass.cpp index dd7ce4708f3e..7bd97b0115ec 100644 --- a/libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_sentinel_for.compile.pass.cpp +++ b/libcxx/test/libcxx/algorithms/specialized.algorithms/special.mem.concepts/nothrow_sentinel_for.compile.pass.cpp @@ -16,3 +16,20 @@ static_assert(std::ranges::__nothrow_sentinel_for); static_assert(!std::ranges::__nothrow_sentinel_for); + +// Because `__nothrow_sentinel_for` is essentially an alias for `sentinel_for`, +// the two concepts should subsume each other. + +constexpr bool ntsf_subsumes_sf(std::ranges::__nothrow_sentinel_for auto) requires true { + return true; +} +constexpr bool ntsf_subsumes_sf(std::sentinel_for auto); + +static_assert(ntsf_subsumes_sf("foo")); + +constexpr bool sf_subsumes_ntsf(std::sentinel_for auto) requires true { + return true; +} +constexpr bool sf_subsumes_ntsf(std::ranges::__nothrow_sentinel_for auto); + +static_assert(sf_subsumes_ntsf("foo"));