[libcxx-commits] [pstl] [pstl] Fix comparison function passed to std::inplace_merge (PR #80265)
via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Feb 1 02:38:57 PST 2024
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff 1bbb797e9c7f37aa814b9bbaba2961f730a26891 86390895753fc7d914cfee02a6b8331cc3dfcbfe -- pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp b/pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp
index 4d706f067b..24b210e3fa 100644
--- a/pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp
+++ b/pstl/test/std/algorithms/alg.merge/inplace_merge.pass.cpp
@@ -147,10 +147,10 @@ main()
test_algo_basic_single<int32_t>(run_for_rnd_bi<test_non_const<int32_t>>());
- test_by_type<MemoryChecker>(
- [](std::size_t idx){ return MemoryChecker{std::int32_t(idx * 2)}; },
- [](std::size_t idx){ return MemoryChecker{std::int32_t(idx * 2 + 1)}; },
- [](const MemoryChecker& val1, const MemoryChecker& val2){ return val1.value() < val2.value(); });
+ test_by_type<MemoryChecker>([](std::size_t idx) { return MemoryChecker{std::int32_t(idx * 2)}; },
+ [](std::size_t idx) { return MemoryChecker{std::int32_t(idx * 2 + 1)}; },
+ [](const MemoryChecker& val1, const MemoryChecker& val2)
+ { return val1.value() < val2.value(); });
EXPECT_FALSE(MemoryChecker::alive_objects() < 0, "wrong effect from inplace_merge: number of ctors calls < num of dtors calls");
EXPECT_FALSE(MemoryChecker::alive_objects() > 0, "wrong effect from inplace_merge: number of ctors calls > num of dtors calls");
``````````
</details>
https://github.com/llvm/llvm-project/pull/80265
More information about the libcxx-commits
mailing list