[libcxx-commits] [libcxx] [libc++][NFC] Add a few clang-format annotations (PR #74352)

via libcxx-commits libcxx-commits at lists.llvm.org
Mon Dec 4 09:52:29 PST 2023


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 f368e6424fbfb7fdea4b9d9a2e44f2f7e188c133 101c10adcfc73509f86414ab2f873f0df7ea2406 -- libcxx/include/__availability libcxx/include/__format/escaped_output_table.h libcxx/include/__format/extended_grapheme_cluster_table.h libcxx/include/__iterator/iter_swap.h libcxx/include/__string/extern_template_lists.h libcxx/include/__utility/integer_sequence.h libcxx/include/bitset libcxx/include/chrono libcxx/include/memory libcxx/include/span libcxx/include/sstream libcxx/include/string libcxx/include/string_view libcxx/include/tuple libcxx/include/unordered_set libcxx/include/vector libcxx/src/locale.cpp
``````````

</details>

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

``````````diff
diff --git a/libcxx/include/__iterator/iter_swap.h b/libcxx/include/__iterator/iter_swap.h
index 510017ac75..bb1116d707 100644
--- a/libcxx/include/__iterator/iter_swap.h
+++ b/libcxx/include/__iterator/iter_swap.h
@@ -77,16 +77,14 @@ namespace __iter_swap {
     }
 
     template <class _T1, class _T2>
-      requires (!__unqualified_iter_swap<_T1, _T2> && //
-                !__readable_swappable<_T1, _T2>) && //
-               indirectly_movable_storable<_T1, _T2> && //
-               indirectly_movable_storable<_T2, _T1>
-    _LIBCPP_HIDE_FROM_ABI
-    constexpr void operator()(_T1&& __x, _T2&& __y) const
-      noexcept(noexcept(iter_value_t<_T2>(ranges::iter_move(__y))) && //
-               noexcept(*__y = ranges::iter_move(__x)) && //
-               noexcept(*_VSTD::forward<_T1>(__x) = std::declval<iter_value_t<_T2>>()))
-    {
+      requires(!__unqualified_iter_swap<_T1, _T2> &&   //
+               !__readable_swappable<_T1, _T2>) &&     //
+              indirectly_movable_storable<_T1, _T2> && //
+              indirectly_movable_storable<_T2, _T1>
+    _LIBCPP_HIDE_FROM_ABI constexpr void operator()(_T1&& __x, _T2&& __y) const
+        noexcept(noexcept(iter_value_t<_T2>(ranges::iter_move(__y))) && //
+                 noexcept(*__y = ranges::iter_move(__x)) &&             //
+                 noexcept(*_VSTD::forward<_T1>(__x) = std::declval<iter_value_t<_T2>>())) {
       iter_value_t<_T2> __old(ranges::iter_move(__y));
       *__y = ranges::iter_move(__x);
       *_VSTD::forward<_T1>(__x) = _VSTD::move(__old);
diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index 16b740b23f..c14141304b 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -1134,7 +1134,7 @@ ctype<char>::classic_table() noexcept
         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
     };
   // clang-format on
-    return builtin_table;
+  return builtin_table;
 }
 #else
 const ctype<char>::mask*

``````````

</details>


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


More information about the libcxx-commits mailing list