[libcxx-commits] [libcxx] [libc++] Prevent calling the projection more than three times (PR #66315)

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Fri Sep 15 07:24:41 PDT 2023


================
@@ -37,9 +37,10 @@ struct __fn {
     _LIBCPP_ASSERT_UNCATEGORIZED(!bool(std::invoke(__comp, std::invoke(__proj, __high), std::invoke(__proj, __low))),
----------------
ldionne wrote:

I think we should also make a similar fix in `std::clamp` (the non-ranges version), and add a test in `libcxx/test/std/algorithms/alg.sorting/alg.clamp/clamp.comp.pass.cpp`.

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


More information about the libcxx-commits mailing list