[libcxx-commits] [libcxx] [libc++][pstl] Improve exception handling (PR #88998)

via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 16 15:36:59 PDT 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 9ddedf07ed80076e0e419940753aeaaf719a09ec b8f74cd33c6d8c44c69a507424b7c9f1fce3959f -- libcxx/test/std/algorithms/pstl.exception_handling.pass.cpp libcxx/include/__algorithm/pstl_copy.h libcxx/include/__algorithm/pstl_count.h libcxx/include/__algorithm/pstl_equal.h libcxx/include/__algorithm/pstl_fill.h libcxx/include/__algorithm/pstl_find.h libcxx/include/__algorithm/pstl_generate.h libcxx/include/__algorithm/pstl_is_partitioned.h libcxx/include/__algorithm/pstl_merge.h libcxx/include/__algorithm/pstl_replace.h libcxx/include/__algorithm/pstl_sort.h libcxx/test/std/numerics/numeric.ops/reduce/pstl.reduce.pass.cpp libcxx/test/std/numerics/numeric.ops/transform.reduce/pstl.transform_reduce.binary.pass.cpp libcxx/test/std/numerics/numeric.ops/transform.reduce/pstl.transform_reduce.unary.pass.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/libcxx/include/__algorithm/pstl_sort.h b/libcxx/include/__algorithm/pstl_sort.h
index bac754dbdb..8268120955 100644
--- a/libcxx/include/__algorithm/pstl_sort.h
+++ b/libcxx/include/__algorithm/pstl_sort.h
@@ -40,8 +40,11 @@ template <class _ExecutionPolicy,
           class _Comp,
           class _RawPolicy                                    = __remove_cvref_t<_ExecutionPolicy>,
           enable_if_t<is_execution_policy_v<_RawPolicy>, int> = 0>
-[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty> __sort(
-    _ExecutionPolicy&& __policy, _RandomAccessIterator&& __first, _RandomAccessIterator&& __last, _Comp&& __comp) noexcept {
+[[nodiscard]] _LIBCPP_HIDE_FROM_ABI optional<__empty>
+__sort(_ExecutionPolicy&& __policy,
+       _RandomAccessIterator&& __first,
+       _RandomAccessIterator&& __last,
+       _Comp&& __comp) noexcept {
   return std::__pstl_frontend_dispatch(
       _LIBCPP_PSTL_CUSTOMIZATION_POINT(__pstl_sort, _RawPolicy),
       [&__policy](_RandomAccessIterator __g_first, _RandomAccessIterator __g_last, _Comp __g_comp) {

``````````

</details>


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


More information about the libcxx-commits mailing list