diff --git a/tests/beman/any_view/constexpr.test.cpp b/tests/beman/any_view/constexpr.test.cpp index 28c541d..3dd5a1e 100644 --- a/tests/beman/any_view/constexpr.test.cpp +++ b/tests/beman/any_view/constexpr.test.cpp @@ -2,8 +2,11 @@ #include +#include "options.hpp" + #include +#include #include using beman::any_view::any_view; @@ -73,3 +76,16 @@ TEST(ConstexprTest, sum_transform_view_of_iota) { #endif EXPECT_EQ(35, sum(view)); } + +constexpr auto sort(any_view view) { + std::ranges::sort(view); + return std::ranges::is_sorted(view); +} + +TEST(ConstexprTest, sort_vector) { +#ifdef __clang__ + // ICE on GCC and MSVC + static_assert(sort(std::vector{6, 8, 7, 5, 3, 0, 9})); +#endif + EXPECT_TRUE(sort(std::vector{6, 8, 7, 5, 3, 0, 9})); +}