[libcxx-commits] [libcxx] [libc++] Fix complexity guarantee in std::clamp (PR #68413)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 23 12:00:42 PDT 2023


================
@@ -82,31 +93,29 @@ constexpr bool test() {
     auto low = S{20};
     auto high = S{30};
     // Check that the value category of the projection return type is preserved.
-    assert(&std::ranges::clamp(val, low, high, Comp{}, &S::lvalue_proj) == &low);
----------------
EricWF wrote:

The test is ensuring we return the object by reference correctly, no?

It's not clear to me why this test would start failing based  off of the double move.

https://github.com/llvm/llvm-project/pull/68413


More information about the libcxx-commits mailing list