[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-10-02 Thread Jocelyn Castellano via cfe-commits
https://github.com/pandaninjas updated https://github.com/llvm/llvm-project/pull/66315 >From ead65bfcb70be46788bc9e88c891e7ae7f91b8d7 Mon Sep 17 00:00:00 2001 From: PandaNinjas Date: Wed, 13 Sep 2023 17:38:17 -0700 Subject: [PATCH 01/22] [libc++] Prevent calling the projection more than three

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-28 Thread Louis Dionne via cfe-commits
ldionne wrote: This seems to be a bit stuck. I checked out the patch locally and that was helpful to understand some of the issues. I think the final patch should be: ``` commit c667f036c4228b9cf0172c311537ab96ef61fcf5 Author: PandaNinjas Date: Wed Sep 13 17:38:17 2023 -0700 [libc++]

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-28 Thread Louis Dionne via cfe-commits
https://github.com/ldionne resolved https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-24 Thread via cfe-commits
github-actions[bot] wrote: :warning: C/C++ code formatter, clang-format found issues in your code. :warning: You can test this locally with the following command: ``bash git-clang-format --diff c60ccfbb898148449946f82cbac6140f1e01cb12 f97313eadac98e753155b5e05ac0eef16f7fb82d --

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-24 Thread A. Jiang via cfe-commits
frederick-vs-ja wrote: It seems that we should remove this block because it turns out that `ranges::clamp` needs double moves under some circumstances.

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-22 Thread Jocelyn Castellano via cfe-commits
pandaninjas wrote: It seems like tests are still failing because there is a double move. https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-19 Thread Jocelyn Castellano via cfe-commits
https://github.com/pandaninjas updated https://github.com/llvm/llvm-project/pull/66315 >From ead65bfcb70be46788bc9e88c891e7ae7f91b8d7 Mon Sep 17 00:00:00 2001 From: PandaNinjas Date: Wed, 13 Sep 2023 17:38:17 -0700 Subject: [PATCH 01/18] [libc++] Prevent calling the projection more than three

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-18 Thread Jocelyn Castellano via cfe-commits
https://github.com/pandaninjas updated https://github.com/llvm/llvm-project/pull/66315 >From ead65bfcb70be46788bc9e88c891e7ae7f91b8d7 Mon Sep 17 00:00:00 2001 From: PandaNinjas Date: Wed, 13 Sep 2023 17:38:17 -0700 Subject: [PATCH 01/17] [libc++] Prevent calling the projection more than three

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-18 Thread Louis Dionne via cfe-commits
https://github.com/ldionne edited https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-18 Thread Louis Dionne via cfe-commits
@@ -37,9 +37,10 @@ struct __fn { _LIBCPP_ASSERT_UNCATEGORIZED(!bool(std::invoke(__comp, std::invoke(__proj, __high), std::invoke(__proj, __low))), "Bad bounds passed to std::ranges::clamp"); -if (std::invoke(__comp,

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-18 Thread Louis Dionne via cfe-commits
https://github.com/ldionne requested changes to this pull request. https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-18 Thread Louis Dionne via cfe-commits
@@ -108,7 +108,34 @@ constexpr bool test() { auto prvalue_proj = [](const CheckDoubleMove& x) -> CheckDoubleMove { return x; }; assert(::ranges::clamp(val, low, high, moving_comp, prvalue_proj) == ); } + { // Make sure we don't call the projection more than three

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-18 Thread Jocelyn Castellano via cfe-commits
https://github.com/pandaninjas updated https://github.com/llvm/llvm-project/pull/66315 >From ead65bfcb70be46788bc9e88c891e7ae7f91b8d7 Mon Sep 17 00:00:00 2001 From: PandaNinjas Date: Wed, 13 Sep 2023 17:38:17 -0700 Subject: [PATCH 01/16] [libc++] Prevent calling the projection more than three

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-18 Thread Louis Dionne via cfe-commits
@@ -108,7 +108,34 @@ constexpr bool test() { auto prvalue_proj = [](const CheckDoubleMove& x) -> CheckDoubleMove { return x; }; assert(::ranges::clamp(val, low, high, moving_comp, prvalue_proj) == ); } + { // Make sure we don't call the projection more than three

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-18 Thread Louis Dionne via cfe-commits
ldionne wrote: > Any idea why the CI is failing? It mentions line 86 not being constexpr > because of assert, but it doesn't seem like I've done anything which should > affect that... I looked into it a bit and I think the CI is failing because of the `std::forward` problem. The assertion on

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-18 Thread Louis Dionne via cfe-commits
https://github.com/ldionne resolved https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-16 Thread Jocelyn Castellano via cfe-commits
pandaninjas wrote: Any idea why the CI is failing? It mentions line 86 not being constexpr because of assert, but it doesn't seem like I've done anything which should affect that... https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Jocelyn Castellano via cfe-commits
https://github.com/pandaninjas updated https://github.com/llvm/llvm-project/pull/66315 >From ead65bfcb70be46788bc9e88c891e7ae7f91b8d7 Mon Sep 17 00:00:00 2001 From: PandaNinjas Date: Wed, 13 Sep 2023 17:38:17 -0700 Subject: [PATCH 01/15] [libc++] Prevent calling the projection more than three

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Jocelyn Castellano via cfe-commits
https://github.com/pandaninjas updated https://github.com/llvm/llvm-project/pull/66315 >From ead65bfcb70be46788bc9e88c891e7ae7f91b8d7 Mon Sep 17 00:00:00 2001 From: PandaNinjas Date: Wed, 13 Sep 2023 17:38:17 -0700 Subject: [PATCH 01/14] [libc++] Prevent calling the projection more than three

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Louis Dionne via cfe-commits
@@ -37,9 +37,10 @@ struct __fn { _LIBCPP_ASSERT_UNCATEGORIZED(!bool(std::invoke(__comp, std::invoke(__proj, __high), std::invoke(__proj, __low))), "Bad bounds passed to std::ranges::clamp"); -if (std::invoke(__comp,

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Louis Dionne via cfe-commits
@@ -108,7 +108,33 @@ constexpr bool test() { auto prvalue_proj = [](const CheckDoubleMove& x) -> CheckDoubleMove { return x; }; assert(::ranges::clamp(val, low, high, moving_comp, prvalue_proj) == ); } + { // Make sure we don't call the projection more than three

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread via cfe-commits
https://github.com/EricWF edited https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread via cfe-commits
@@ -37,9 +37,10 @@ struct __fn { _LIBCPP_ASSERT_UNCATEGORIZED(!bool(std::invoke(__comp, std::invoke(__proj, __high), std::invoke(__proj, __low))), "Bad bounds passed to std::ranges::clamp"); -if (std::invoke(__comp,

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread via cfe-commits
https://github.com/EricWF requested changes to this pull request. https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Jocelyn Castellano via cfe-commits
https://github.com/pandaninjas updated https://github.com/llvm/llvm-project/pull/66315 >From ead65bfcb70be46788bc9e88c891e7ae7f91b8d7 Mon Sep 17 00:00:00 2001 From: PandaNinjas Date: Wed, 13 Sep 2023 17:38:17 -0700 Subject: [PATCH 01/13] [libc++] Prevent calling the projection more than three

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Jocelyn Castellano via cfe-commits
https://github.com/pandaninjas resolved https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Jocelyn Castellano via cfe-commits
https://github.com/pandaninjas resolved https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Jocelyn Castellano via cfe-commits
https://github.com/pandaninjas resolved https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Louis Dionne via cfe-commits
ldionne wrote: What a tricky change! The ones that seem simple are sometimes the ones that end up being the most involved :) https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Louis Dionne via cfe-commits
@@ -37,9 +37,10 @@ struct __fn { _LIBCPP_ASSERT_UNCATEGORIZED(!bool(std::invoke(__comp, std::invoke(__proj, __high), std::invoke(__proj, __low))), "Bad bounds passed to std::ranges::clamp"); -if (std::invoke(__comp,

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Louis Dionne via cfe-commits
@@ -108,7 +108,33 @@ constexpr bool test() { auto prvalue_proj = [](const CheckDoubleMove& x) -> CheckDoubleMove { return x; }; assert(::ranges::clamp(val, low, high, moving_comp, prvalue_proj) == ); } + { // Make sure we don't call the projection more than three

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Louis Dionne via cfe-commits
https://github.com/ldionne edited https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Louis Dionne via cfe-commits
@@ -37,9 +37,10 @@ struct __fn { _LIBCPP_ASSERT_UNCATEGORIZED(!bool(std::invoke(__comp, std::invoke(__proj, __high), std::invoke(__proj, __low))), "Bad bounds passed to std::ranges::clamp"); -if (std::invoke(__comp,

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Louis Dionne via cfe-commits
@@ -108,7 +108,33 @@ constexpr bool test() { auto prvalue_proj = [](const CheckDoubleMove& x) -> CheckDoubleMove { return x; }; assert(::ranges::clamp(val, low, high, moving_comp, prvalue_proj) == ); } + { // Make sure we don't call the projection more than three

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Louis Dionne via cfe-commits
https://github.com/ldionne requested changes to this pull request. https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Louis Dionne via cfe-commits
@@ -37,9 +37,10 @@ struct __fn { _LIBCPP_ASSERT_UNCATEGORIZED(!bool(std::invoke(__comp, std::invoke(__proj, __high), std::invoke(__proj, __low))), "Bad bounds passed to std::ranges::clamp"); -if (std::invoke(__comp,

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Jocelyn Castellano via cfe-commits
https://github.com/pandaninjas updated https://github.com/llvm/llvm-project/pull/66315 >From ead65bfcb70be46788bc9e88c891e7ae7f91b8d7 Mon Sep 17 00:00:00 2001 From: PandaNinjas Date: Wed, 13 Sep 2023 17:38:17 -0700 Subject: [PATCH 01/12] [libc++] Prevent calling the projection more than three

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Jocelyn Castellano via cfe-commits
https://github.com/pandaninjas updated https://github.com/llvm/llvm-project/pull/66315 >From ead65bfcb70be46788bc9e88c891e7ae7f91b8d7 Mon Sep 17 00:00:00 2001 From: PandaNinjas Date: Wed, 13 Sep 2023 17:38:17 -0700 Subject: [PATCH 01/11] [libc++] Prevent calling the projection more than three

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Jocelyn Castellano via cfe-commits
https://github.com/pandaninjas updated https://github.com/llvm/llvm-project/pull/66315 >From ead65bfcb70be46788bc9e88c891e7ae7f91b8d7 Mon Sep 17 00:00:00 2001 From: PandaNinjas Date: Wed, 13 Sep 2023 17:38:17 -0700 Subject: [PATCH 01/10] [libc++] Prevent calling the projection more than three

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Jocelyn Castellano via cfe-commits
https://github.com/pandaninjas updated https://github.com/llvm/llvm-project/pull/66315 >From ead65bfcb70be46788bc9e88c891e7ae7f91b8d7 Mon Sep 17 00:00:00 2001 From: PandaNinjas Date: Wed, 13 Sep 2023 17:38:17 -0700 Subject: [PATCH 1/9] [libc++] Prevent calling the projection more than three

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Louis Dionne via cfe-commits
https://github.com/ldionne resolved https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Louis Dionne via cfe-commits
@@ -37,9 +37,10 @@ struct __fn { _LIBCPP_ASSERT_UNCATEGORIZED(!bool(std::invoke(__comp, std::invoke(__proj, __high), std::invoke(__proj, __low))), "Bad bounds passed to std::ranges::clamp"); -if (std::invoke(__comp,

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Louis Dionne via cfe-commits
https://github.com/ldionne requested changes to this pull request. https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Louis Dionne via cfe-commits
https://github.com/ldionne edited https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Louis Dionne via cfe-commits
https://github.com/ldionne resolved https://github.com/llvm/llvm-project/pull/66315 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Louis Dionne via cfe-commits
@@ -37,9 +37,10 @@ struct __fn { _LIBCPP_ASSERT_UNCATEGORIZED(!bool(std::invoke(__comp, std::invoke(__proj, __high), std::invoke(__proj, __low))), ldionne wrote: You're right, sorry for the noise. It supports a custom comparator, not a custom projection.

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Jocelyn Castellano via cfe-commits
https://github.com/pandaninjas updated https://github.com/llvm/llvm-project/pull/66315 >From ead65bfcb70be46788bc9e88c891e7ae7f91b8d7 Mon Sep 17 00:00:00 2001 From: PandaNinjas Date: Wed, 13 Sep 2023 17:38:17 -0700 Subject: [PATCH 1/9] [libc++] Prevent calling the projection more than three

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Jocelyn Castellano via cfe-commits
@@ -37,9 +37,10 @@ struct __fn { _LIBCPP_ASSERT_UNCATEGORIZED(!bool(std::invoke(__comp, std::invoke(__proj, __high), std::invoke(__proj, __low))), pandaninjas wrote: I think we don't need a similar fix in `std::clamp` because `std::clamp` doesn't support

[clang-tools-extra] [libc++] Prevent calling the projection more than three times (PR #66315)

2023-09-15 Thread Jocelyn Castellano via cfe-commits
https://github.com/pandaninjas updated https://github.com/llvm/llvm-project/pull/66315 >From ead65bfcb70be46788bc9e88c891e7ae7f91b8d7 Mon Sep 17 00:00:00 2001 From: PandaNinjas Date: Wed, 13 Sep 2023 17:38:17 -0700 Subject: [PATCH 1/8] [libc++] Prevent calling the projection more than three