[libcxx-commits] [libcxx] [libc++][NFC] Run clang-format on libcxx/include again (PR #95874)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jun 17 19:13:24 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Louis Dionne (ldionne)
<details>
<summary>Changes</summary>
As time went by, a few files have become mis-formatted w.r.t. clang-format. This was made worse by the fact that formatting was not being enforced in extensionless headers. This commit simply brings all of libcxx/include in-line with clang-format again.
We might have to do this from time to time as we update our clang-format version, but frankly this is really low effort now that we've formatted everything once.
---
Patch is 156.15 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/95874.diff
80 Files Affected:
- (modified) libcxx/include/__algorithm/comp_ref_type.h (+3-3)
- (modified) libcxx/include/__algorithm/make_projected.h (+4-4)
- (modified) libcxx/include/__atomic/atomic_init.h (+2-4)
- (modified) libcxx/include/__bit_reference (+8-8)
- (modified) libcxx/include/__chrono/duration.h (+6-6)
- (modified) libcxx/include/__chrono/time_point.h (+10-10)
- (modified) libcxx/include/__config (+6-6)
- (modified) libcxx/include/__configuration/abi.h (+1-1)
- (modified) libcxx/include/__exception/exception_ptr.h (+5-4)
- (modified) libcxx/include/__format/formatter_output.h (+11-9)
- (modified) libcxx/include/__functional/bind.h (+4-4)
- (modified) libcxx/include/__functional/bind_back.h (+1-1)
- (modified) libcxx/include/__functional/bind_front.h (+2-3)
- (modified) libcxx/include/__functional/mem_fn.h (+2-2)
- (modified) libcxx/include/__functional/mem_fun_ref.h (+2-2)
- (modified) libcxx/include/__functional/operations.h (+38-35)
- (modified) libcxx/include/__functional/pointer_to_binary_function.h (+2-2)
- (modified) libcxx/include/__functional/pointer_to_unary_function.h (+2-2)
- (modified) libcxx/include/__functional/unary_negate.h (+2-2)
- (modified) libcxx/include/__iterator/access.h (+2-2)
- (modified) libcxx/include/__iterator/bounded_iter.h (+2-2)
- (modified) libcxx/include/__iterator/cpp17_iterator_concepts.h (+1-1)
- (modified) libcxx/include/__iterator/iter_swap.h (+1-1)
- (modified) libcxx/include/__iterator/move_iterator.h (+2-2)
- (modified) libcxx/include/__iterator/reverse_iterator.h (+5-6)
- (modified) libcxx/include/__iterator/wrap_iter.h (+2-2)
- (modified) libcxx/include/__mdspan/mdspan.h (+2-2)
- (modified) libcxx/include/__memory/allocate_at_least.h (+3-3)
- (modified) libcxx/include/__memory/pointer_traits.h (+9-9)
- (modified) libcxx/include/__memory/unique_ptr.h (+6-6)
- (modified) libcxx/include/__ranges/access.h (+2-3)
- (modified) libcxx/include/__ranges/all.h (+2-3)
- (modified) libcxx/include/__ranges/common_view.h (+4-6)
- (modified) libcxx/include/__ranges/counted.h (+2-3)
- (modified) libcxx/include/__ranges/data.h (+2-3)
- (modified) libcxx/include/__ranges/drop_view.h (+6-6)
- (modified) libcxx/include/__ranges/lazy_split_view.h (+2-2)
- (modified) libcxx/include/__ranges/rend.h (+2-3)
- (modified) libcxx/include/__ranges/reverse_view.h (+2-3)
- (modified) libcxx/include/__ranges/subrange.h (+5-6)
- (modified) libcxx/include/__split_buffer (+2-2)
- (modified) libcxx/include/__tuple/sfinae_helpers.h (+2-2)
- (modified) libcxx/include/__tuple/tuple_size.h (+1-1)
- (modified) libcxx/include/__type_traits/invoke.h (+2-2)
- (modified) libcxx/include/__type_traits/is_literal_type.h (+2-2)
- (modified) libcxx/include/__type_traits/is_swappable.h (+2-2)
- (modified) libcxx/include/__utility/exception_guard.h (+2-2)
- (modified) libcxx/include/__utility/forward_like.h (+2-2)
- (modified) libcxx/include/__utility/is_pointer_in_range.h (+4-4)
- (modified) libcxx/include/__verbose_abort (+1-1)
- (modified) libcxx/include/any (+3-3)
- (modified) libcxx/include/array (+1-3)
- (modified) libcxx/include/barrier (+2-2)
- (modified) libcxx/include/cmath (+3-3)
- (modified) libcxx/include/codecvt (+2-2)
- (modified) libcxx/include/coroutine (+4-4)
- (modified) libcxx/include/fstream (+4-4)
- (modified) libcxx/include/limits (+54-18)
- (modified) libcxx/include/locale (+10-10)
- (modified) libcxx/include/map (+10-8)
- (modified) libcxx/include/mutex (+2-2)
- (modified) libcxx/include/new (+7-12)
- (modified) libcxx/include/optional (+6-6)
- (modified) libcxx/include/print (+6-2)
- (modified) libcxx/include/queue (+4-4)
- (modified) libcxx/include/regex (+2-2)
- (modified) libcxx/include/scoped_allocator (+1-1)
- (modified) libcxx/include/set (+12-8)
- (modified) libcxx/include/shared_mutex (+2-2)
- (modified) libcxx/include/span (+8-8)
- (modified) libcxx/include/stack (+12-10)
- (modified) libcxx/include/string (+33-32)
- (modified) libcxx/include/string_view (+1-3)
- (modified) libcxx/include/strstream (+14-14)
- (modified) libcxx/include/tuple (+33-33)
- (modified) libcxx/include/unordered_map (+10-14)
- (modified) libcxx/include/unordered_set (+7-7)
- (modified) libcxx/include/valarray (+78-78)
- (modified) libcxx/include/variant (+10-10)
- (modified) libcxx/include/vector (+7-7)
``````````diff
diff --git a/libcxx/include/__algorithm/comp_ref_type.h b/libcxx/include/__algorithm/comp_ref_type.h
index aa9350c38caa9..c367fbb91ac28 100644
--- a/libcxx/include/__algorithm/comp_ref_type.h
+++ b/libcxx/include/__algorithm/comp_ref_type.h
@@ -41,9 +41,9 @@ struct __debug_less {
}
template <class _LHS, class _RHS>
- _LIBCPP_CONSTEXPR_SINCE_CXX14 inline _LIBCPP_HIDE_FROM_ABI decltype((void)std::declval<_Compare&>()(
- std::declval<_LHS&>(), std::declval<_RHS&>()))
- __do_compare_assert(int, _LHS& __l, _RHS& __r) {
+ _LIBCPP_CONSTEXPR_SINCE_CXX14 inline
+ _LIBCPP_HIDE_FROM_ABI decltype((void)std::declval<_Compare&>()(std::declval<_LHS&>(), std::declval<_RHS&>()))
+ __do_compare_assert(int, _LHS& __l, _RHS& __r) {
_LIBCPP_ASSERT_SEMANTIC_REQUIREMENT(!__comp_(__l, __r), "Comparator does not induce a strict weak ordering");
(void)__l;
(void)__r;
diff --git a/libcxx/include/__algorithm/make_projected.h b/libcxx/include/__algorithm/make_projected.h
index bb7bc7e8c0b58..5245e523f3df2 100644
--- a/libcxx/include/__algorithm/make_projected.h
+++ b/libcxx/include/__algorithm/make_projected.h
@@ -36,8 +36,8 @@ struct _ProjectedPred {
: __pred(__pred_arg), __proj(__proj_arg) {}
template <class _Tp>
- typename __invoke_of<_Pred&, decltype(std::__invoke(std::declval<_Proj&>(), std::declval<_Tp>())) >::
- type _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI
+ typename __invoke_of<_Pred&, decltype(std::__invoke(std::declval<_Proj&>(), std::declval<_Tp>()))>::type
+ _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI
operator()(_Tp&& __v) const {
return std::__invoke(__pred, std::__invoke(__proj, std::forward<_Tp>(__v)));
}
@@ -45,8 +45,8 @@ struct _ProjectedPred {
template <class _T1, class _T2>
typename __invoke_of<_Pred&,
decltype(std::__invoke(std::declval<_Proj&>(), std::declval<_T1>())),
- decltype(std::__invoke(std::declval<_Proj&>(),
- std::declval<_T2>())) >::type _LIBCPP_CONSTEXPR _LIBCPP_HIDE_FROM_ABI
+ decltype(std::__invoke(std::declval<_Proj&>(), std::declval<_T2>()))>::type _LIBCPP_CONSTEXPR
+ _LIBCPP_HIDE_FROM_ABI
operator()(_T1&& __lhs, _T2&& __rhs) const {
return std::__invoke(
__pred, std::__invoke(__proj, std::forward<_T1>(__lhs)), std::__invoke(__proj, std::forward<_T2>(__rhs)));
diff --git a/libcxx/include/__atomic/atomic_init.h b/libcxx/include/__atomic/atomic_init.h
index 8ef5958bfedaa..2ed37a9a77c86 100644
--- a/libcxx/include/__atomic/atomic_init.h
+++ b/libcxx/include/__atomic/atomic_init.h
@@ -15,10 +15,8 @@
# pragma GCC system_header
#endif
-#define ATOMIC_FLAG_INIT \
- { false }
-#define ATOMIC_VAR_INIT(__v) \
- { __v }
+#define ATOMIC_FLAG_INIT {false}
+#define ATOMIC_VAR_INIT(__v) {__v}
#if _LIBCPP_STD_VER >= 20 && !defined(_LIBCPP_DISABLE_DEPRECATION_WARNINGS)
# pragma clang deprecated(ATOMIC_VAR_INIT)
diff --git a/libcxx/include/__bit_reference b/libcxx/include/__bit_reference
index 9579b9eaf70bb..93f654a67c5fe 100644
--- a/libcxx/include/__bit_reference
+++ b/libcxx/include/__bit_reference
@@ -95,8 +95,8 @@ public:
}
private:
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit __bit_reference(
- __storage_pointer __s, __storage_type __m) _NOEXCEPT
+ _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit __bit_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
: __seg_(__s),
__mask_(__m) {}
};
@@ -163,8 +163,8 @@ public:
}
private:
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR explicit __bit_const_reference(
- __storage_pointer __s, __storage_type __m) _NOEXCEPT
+ _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_CONSTEXPR explicit __bit_const_reference(__storage_pointer __s, __storage_type __m) _NOEXCEPT
: __seg_(__s),
__mask_(__m) {}
@@ -940,8 +940,8 @@ public:
}
private:
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit __bit_iterator(
- __storage_pointer __s, unsigned __ctz) _NOEXCEPT
+ _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 explicit __bit_iterator(__storage_pointer __s, unsigned __ctz) _NOEXCEPT
: __seg_(__s),
__ctz_(__ctz) {}
@@ -1000,8 +1000,8 @@ private:
_LIBCPP_CONSTEXPR_SINCE_CXX20 friend __bit_iterator<_Dp, _IC>
__find_bool(__bit_iterator<_Dp, _IC>, typename _Dp::size_type);
template <bool _ToCount, class _Dp, bool _IC>
- friend typename __bit_iterator<_Dp, _IC>::difference_type _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
- __count_bool(__bit_iterator<_Dp, _IC>, typename _Dp::size_type);
+ friend typename __bit_iterator<_Dp, _IC>::difference_type _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_CONSTEXPR_SINCE_CXX20 __count_bool(__bit_iterator<_Dp, _IC>, typename _Dp::size_type);
};
_LIBCPP_END_NAMESPACE_STD
diff --git a/libcxx/include/__chrono/duration.h b/libcxx/include/__chrono/duration.h
index 1e81420244b14..1e36d7342836f 100644
--- a/libcxx/include/__chrono/duration.h
+++ b/libcxx/include/__chrono/duration.h
@@ -391,8 +391,8 @@ operator<=>(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Perio
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
- typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
- operator+(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {
+typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
+operator+(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {
typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd;
return _Cd(_Cd(__lhs).count() + _Cd(__rhs).count());
}
@@ -401,8 +401,8 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
- typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
- operator-(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {
+typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
+operator-(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {
typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd;
return _Cd(_Cd(__lhs).count() - _Cd(__rhs).count());
}
@@ -468,8 +468,8 @@ operator%(const duration<_Rep1, _Period>& __d, const _Rep2& __s) {
template <class _Rep1, class _Period1, class _Rep2, class _Period2>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
- typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
- operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {
+typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type
+operator%(const duration<_Rep1, _Period1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {
typedef typename common_type<_Rep1, _Rep2>::type _Cr;
typedef typename common_type<duration<_Rep1, _Period1>, duration<_Rep2, _Period2> >::type _Cd;
return _Cd(static_cast<_Cr>(_Cd(__lhs).count()) % static_cast<_Cr>(_Cd(__rhs).count()));
diff --git a/libcxx/include/__chrono/time_point.h b/libcxx/include/__chrono/time_point.h
index e65253ddb98ee..cb5bf4d13f705 100644
--- a/libcxx/include/__chrono/time_point.h
+++ b/libcxx/include/__chrono/time_point.h
@@ -78,7 +78,7 @@ class _LIBCPP_TEMPLATE_VIS time_point {
template <class _Clock, class _Duration1, class _Duration2>
struct _LIBCPP_TEMPLATE_VIS
- common_type<chrono::time_point<_Clock, _Duration1>, chrono::time_point<_Clock, _Duration2> > {
+common_type<chrono::time_point<_Clock, _Duration1>, chrono::time_point<_Clock, _Duration2> > {
typedef chrono::time_point<_Clock, typename common_type<_Duration1, _Duration2>::type> type;
};
@@ -180,9 +180,9 @@ operator<=>(const time_point<_Clock, _Duration1>& __lhs, const time_point<_Clock
// time_point operator+(time_point x, duration y);
template <class _Clock, class _Duration1, class _Rep2, class _Period2>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
- time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type>
- operator+(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {
+inline _LIBCPP_HIDE_FROM_ABI
+_LIBCPP_CONSTEXPR_SINCE_CXX14 time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type>
+operator+(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {
typedef time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> _Tr;
return _Tr(__lhs.time_since_epoch() + __rhs);
}
@@ -190,18 +190,18 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
// time_point operator+(duration x, time_point y);
template <class _Rep1, class _Period1, class _Clock, class _Duration2>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
- time_point<_Clock, typename common_type<duration<_Rep1, _Period1>, _Duration2>::type>
- operator+(const duration<_Rep1, _Period1>& __lhs, const time_point<_Clock, _Duration2>& __rhs) {
+inline _LIBCPP_HIDE_FROM_ABI
+_LIBCPP_CONSTEXPR_SINCE_CXX14 time_point<_Clock, typename common_type<duration<_Rep1, _Period1>, _Duration2>::type>
+operator+(const duration<_Rep1, _Period1>& __lhs, const time_point<_Clock, _Duration2>& __rhs) {
return __rhs + __lhs;
}
// time_point operator-(time_point x, duration y);
template <class _Clock, class _Duration1, class _Rep2, class _Period2>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
- time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type>
- operator-(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {
+inline _LIBCPP_HIDE_FROM_ABI
+_LIBCPP_CONSTEXPR_SINCE_CXX14 time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type>
+operator-(const time_point<_Clock, _Duration1>& __lhs, const duration<_Rep2, _Period2>& __rhs) {
typedef time_point<_Clock, typename common_type<_Duration1, duration<_Rep2, _Period2> >::type> _Ret;
return _Ret(__lhs.time_since_epoch() - __rhs);
}
diff --git a/libcxx/include/__config b/libcxx/include/__config
index aac8c70c74a33..dfb14fd6a380c 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -566,7 +566,7 @@ typedef __char32_t char32_t;
# ifndef _LIBCPP_NO_ABI_TAG
# define _LIBCPP_HIDE_FROM_ABI \
_LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION \
- __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))))
+ __attribute__((__abi_tag__(_LIBCPP_TOSTRING(_LIBCPP_ODR_SIGNATURE))))
# else
# define _LIBCPP_HIDE_FROM_ABI _LIBCPP_HIDDEN _LIBCPP_EXCLUDE_FROM_EXPLICIT_INSTANTIATION
# endif
@@ -583,11 +583,11 @@ typedef __char32_t char32_t;
# endif
// TODO: Remove this workaround once we drop support for Clang 16
-#if __has_warning("-Wc++23-extensions")
-# define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED_CXX23_EXTENSION _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++23-extensions")
-#else
-# define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED_CXX23_EXTENSION _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++2b-extensions")
-#endif
+# if __has_warning("-Wc++23-extensions")
+# define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED_CXX23_EXTENSION _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++23-extensions")
+# else
+# define _LIBCPP_CLANG_DIAGNOSTIC_IGNORED_CXX23_EXTENSION _LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wc++2b-extensions")
+# endif
// Clang modules take a significant compile time hit when pushing and popping diagnostics.
// Since all the headers are marked as system headers in the modulemap, we can simply disable this
diff --git a/libcxx/include/__configuration/abi.h b/libcxx/include/__configuration/abi.h
index 73375fa47d07f..513da6e3b81b6 100644
--- a/libcxx/include/__configuration/abi.h
+++ b/libcxx/include/__configuration/abi.h
@@ -90,7 +90,7 @@
# define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_ARRAY
# define _LIBCPP_ABI_USE_WRAP_ITER_IN_STD_STRING_VIEW
// Dont' add an inline namespace for `std::filesystem`
-# define _LIBCPP_ABI_NO_FILESYSTEM_INLINE_NAMESPACE
+# define _LIBCPP_ABI_NO_FILESYSTEM_INLINE_NAMESPACE
#elif _LIBCPP_ABI_VERSION == 1
# if !(defined(_LIBCPP_OBJECT_FORMAT_COFF) || defined(_LIBCPP_OBJECT_FORMAT_XCOFF))
// Enable compiling copies of now inline methods into the dylib to support
diff --git a/libcxx/include/__exception/exception_ptr.h b/libcxx/include/__exception/exception_ptr.h
index edb81caac0991..beadd9212abd1 100644
--- a/libcxx/include/__exception/exception_ptr.h
+++ b/libcxx/include/__exception/exception_ptr.h
@@ -99,15 +99,16 @@ _LIBCPP_HIDE_FROM_ABI exception_ptr make_exception_ptr(_Ep __e) _NOEXCEPT {
void* __ex = __cxxabiv1::__cxa_allocate_exception(sizeof(_Ep));
# ifdef __wasm__
// In Wasm, a destructor returns its argument
- (void)__cxxabiv1::__cxa_init_primary_exception(__ex, const_cast<std::type_info*>(&typeid(_Ep)), [](void* __p) -> void* {
+ (void)__cxxabiv1::__cxa_init_primary_exception(
+ __ex, const_cast<std::type_info*>(&typeid(_Ep)), [](void* __p) -> void* {
# else
(void)__cxxabiv1::__cxa_init_primary_exception(__ex, const_cast<std::type_info*>(&typeid(_Ep)), [](void* __p) {
# endif
- std::__destroy_at(static_cast<_Ep2*>(__p));
+ std::__destroy_at(static_cast<_Ep2*>(__p));
# ifdef __wasm__
- return __p;
+ return __p;
# endif
- });
+ });
try {
::new (__ex) _Ep2(__e);
diff --git a/libcxx/include/__format/formatter_output.h b/libcxx/include/__format/formatter_output.h
index d5038eb158b0a..1498f64c4aeff 100644
--- a/libcxx/include/__format/formatter_output.h
+++ b/libcxx/include/__format/formatter_output.h
@@ -100,8 +100,8 @@ __padding_size(size_t __size, size_t __width, __format_spec::__alignment __align
///
/// This uses a "mass output function" of __format::__output_buffer when possible.
template <__fmt_char_type _CharT, __fmt_char_type _OutCharT = _CharT>
-_LIBCPP_HIDE_FROM_ABI auto __copy(basic_string_view<_CharT> __str, output_iterator<const _OutCharT&> auto __out_it)
- -> decltype(__out_it) {
+_LIBCPP_HIDE_FROM_ABI auto
+__copy(basic_string_view<_CharT> __str, output_iterator<const _OutCharT&> auto __out_it) -> decltype(__out_it) {
if constexpr (std::same_as<decltype(__out_it), std::back_insert_iterator<__format::__output_buffer<_OutCharT>>>) {
__out_it.__get_container()->__copy(__str);
return __out_it;
@@ -116,16 +116,16 @@ _LIBCPP_HIDE_FROM_ABI auto __copy(basic_string_view<_CharT> __str, output_iterat
template <contiguous_iterator _Iterator,
__fmt_char_type _CharT = typename iterator_traits<_Iterator>::value_type,
__fmt_char_type _OutCharT = _CharT>
-_LIBCPP_HIDE_FROM_ABI auto __copy(_Iterator __first, _Iterator __last, output_iterator<const _OutCharT&> auto __out_it)
- -> decltype(__out_it) {
+_LIBCPP_HIDE_FROM_ABI auto
+__copy(_Iterator __first, _Iterator __last, output_iterator<const _OutCharT&> auto __out_it) -> decltype(__out_it) {
return __formatter::__copy(basic_string_view{__first, __last}, std::move(__out_it));
}
template <contiguous_iterator _Iterator,
__fmt_char_type _CharT = typename iterator_traits<_Iterator>::value_type,
__fmt_char_type _OutCharT = _CharT>
-_LIBCPP_HIDE_FROM_ABI auto __copy(_Iterator __first, size_t __n, output_iterator<const _OutCharT&> auto __out_it)
- -> decltype(__out_it) {
+_LIBCPP_HIDE_FROM_ABI auto
+__copy(_Iterator __first, size_t __n, output_iterator<const _OutCharT&> auto __out_it) -> decltype(__out_it) {
return __formatter::__copy(basic_string_view{std::to_address(__first), __n}, std::move(__out_it));
}
@@ -136,9 +136,11 @@ template <contiguous_iterator _Iterator,
__fmt_char_type _CharT = typename iterator_traits<_Iterator>::value_type,
__fmt_char_type _OutCharT = _CharT,
class _UnaryOperation>
-_LIBCPP_HIDE_FROM_ABI auto __transform(
- _Iterator __first, _Iterator __last, output_iterator<const _OutCharT&> auto __out_it, _UnaryOperation __operation)
- -> decltype(__out_it) {
+_LIBCPP_HIDE_FROM_ABI auto
+__transform(_Iterator __first,
+ _Iterator __last,
+ output_iterator<const _OutCharT&> auto __out_it,
+ _UnaryOperation __operation) -> decltype(__out_it) {
if constexpr (std::same_as<decltype(__out_it), std::back_insert_iterator<__format::__output_buffer<_OutCharT>>>) {
__out_it.__get_container()->__transform(__first, __last, std::move(__operation));
return __out_it;
diff --git a/libcxx/include/__functional/bind.h b/libcxx/include/__functional/bind.h
index 385dabaee424d..b4f46441da507 100644
--- a/libcxx/include/__functional/bind.h
+++ b/libcxx/include/__functional/bind.h
@@ -105,8 +105,8 @@ struct __mu_return2<true, _Ti, _Uj> {
template <class _Ti, class _Uj, __enable_if_t<0 < is_placeholder<_Ti>::value, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
- typename __mu_return2<0 < is_placeholder<_Ti>::value, _Ti, _Uj>::type
- __mu(_Ti&, _Uj& __uj) {
+typename __mu_return2<0 < is_placeholder<_Ti>::value, _Ti, _Uj>::type
+__mu(_Ti&, _Uj& __uj) {
const size_t __indx = is_placeholder<_Ti>::value - 1;
return std::forward<typename tuple_element<__indx, _Uj>::type>(std::get<__indx>(__uj));
}
@@ -225,8 +225,8 @@ class __bind : public __weak_result_type<__decay_t<_Fp> > {
template <class... _Args>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
- typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type
- operator()(_Args&&... __args) const {
+ typename __bind_return<const _Fd, const _Td, tuple<_Args&&...> >::type
+ operator()(_Args&&... __args) const {
return std::__apply_functor(__f_, __bound_args_, __indices(), tuple<_Args&&...>(std::forward<_Args>(__args)...));
}
};
diff --git a/libcxx/include/__functional/bind_back.h b/libcxx/include/__functional/bind_back.h
index 3c42d4769e8a9..e44768d2283c0 100644
--- a/libcxx/include/__functional/bind_back.h
+++ b/libcxx/include/__functional/bind_back.h
@@ -52,7 +52,7 @@ struct __bind_back_t : __perfect_forward<__bind_back_op<tuple_size_v<_BoundArgs>
template <class _Fn, class... _Args>
requires is_constructible_v<decay_t<_Fn>, _Fn> && is_move_constructible_v<decay_t<_Fn>> &&
- (is_constructible_v<decay_t<_Args>, _Args> && ...) && (is_move_constructible_v<decay_t<_Args>> && ...)
+ (is_constructible_v<decay_t<_Args>, _Args> && ...) && (is_move_constructible_v<decay_t<_Args>> && ...)
_LIBCPP_HIDE_FROM_ABI constexpr auto __bind_back(_Fn&& __f, _Args&&... __args) noexcept(
noexcept(__bind_back_t<decay_t<_Fn>, tuple<decay_t<_Args>...>>(
std::forward<_Fn>(__f), std::forward_as_tuple(std::forward<_Args>(__args)...))))
diff --git a/libcxx/include/__functional/bind_front.h b/libcxx/include/__functional/bind_front.h
index 11d0bac3f839c..87ef3affe80b6 100644
--- a/libcxx/include/__functional/bind_front.h
+++ b/libcxx/include/__functional/bind_front.h
@@ -29,9 +29,8 @@ _LIBCPP_BEGIN_NAMESPACE_STD
struct __bind_front_op {
template <class... _Args>
- _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) const
- noexcept(noexcept(std::invoke(std::forward<_Args>(__args)...)))
- -> decltype(std::invoke(std::forward<_Args>(__args)...)) {
+ _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Args&&... __args) const noexcept(
+ noexcept(std::invoke(std::forward<_Args>(__args)...))) -> decltype(std::invoke(std::forward<_Args>(__args)...)) {
return std::invoke(std::forward<_Args>(__args)...);
}
};
diff --git a/libcxx/include/__functional/mem_fn.h b/libcxx/include/__functional/mem_fn.h
index 349a6ce3a7572..ee07a71774f9a 100644
--- a/libcxx/include/__functional/mem_fn.h
+++ b/libcxx/include/__functional/mem_fn.h
@@ -38,8 +38,8 @@ class __mem_fn : public __we...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/95874
More information about the libcxx-commits
mailing list