[libcxx-commits] [libcxx] [libc++][C++03] Backport #111127, #112843 and #121620 (PR #155571)
via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Aug 27 00:54:43 PDT 2025
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 HEAD~1 HEAD --extensions ,cpp -- libcxx/include/__cxx03/bitset libcxx/include/__cxx03/forward_list libcxx/include/__cxx03/list libcxx/test/std/containers/sequences/forwardlist/types.pass.cpp libcxx/test/std/containers/sequences/list/types.pass.cpp libcxx/test/std/utilities/template.bitset/bitset.members/nonstdmem.uglified.compile.pass.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/libcxx/include/__cxx03/forward_list b/libcxx/include/__cxx03/forward_list
index 03c3c466c..da7d9f18f 100644
--- a/libcxx/include/__cxx03/forward_list
+++ b/libcxx/include/__cxx03/forward_list
@@ -742,7 +742,8 @@ forward_list<_Tp, _Alloc>::forward_list(_InputIterator __f, _InputIterator __l)
template <class _Tp, class _Alloc>
template <class _InputIterator, __enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> >
-forward_list<_Tp, _Alloc>::forward_list(_InputIterator __f, _InputIterator __l, const allocator_type& __a) : __base(__a) {
+forward_list<_Tp, _Alloc>::forward_list(_InputIterator __f, _InputIterator __l, const allocator_type& __a)
+ : __base(__a) {
insert_after(cbefore_begin(), __f, __l);
}
@@ -807,7 +808,7 @@ void forward_list<_Tp, _Alloc>::push_front(const value_type& __v) {
template <class _Tp, class _Alloc>
void forward_list<_Tp, _Alloc>::pop_front() {
- __node_pointer __p = __base::__before_begin()->__next_;
+ __node_pointer __p = __base::__before_begin()->__next_;
__base::__before_begin()->__next_ = __p->__next_;
this->__delete_node(__p);
}
diff --git a/libcxx/include/__cxx03/list b/libcxx/include/__cxx03/list
index 73efecc57..c03af3dca 100644
--- a/libcxx/include/__cxx03/list
+++ b/libcxx/include/__cxx03/list
@@ -779,19 +779,19 @@ inline void list<_Tp, _Alloc>::__link_nodes(__link_pointer __p, __link_pointer _
// Link in nodes [__f, __l] at the front of the list
template <class _Tp, class _Alloc>
inline void list<_Tp, _Alloc>::__link_nodes_at_front(__link_pointer __f, __link_pointer __l) {
- __f->__prev_ = __base::__end_as_link();
- __l->__next_ = __base::__end_.__next_;
+ __f->__prev_ = __base::__end_as_link();
+ __l->__next_ = __base::__end_.__next_;
__l->__next_->__prev_ = __l;
- __base::__end_.__next_ = __f;
+ __base::__end_.__next_ = __f;
}
// Link in nodes [__f, __l] at the back of the list
template <class _Tp, class _Alloc>
inline void list<_Tp, _Alloc>::__link_nodes_at_back(__link_pointer __f, __link_pointer __l) {
- __l->__next_ = __base::__end_as_link();
- __f->__prev_ = __base::__end_.__prev_;
+ __l->__next_ = __base::__end_as_link();
+ __f->__prev_ = __base::__end_.__prev_;
__f->__prev_->__next_ = __f;
- __base::__end_.__prev_ = __l;
+ __base::__end_.__prev_ = __l;
}
template <class _Tp, class _Alloc>
``````````
</details>
https://github.com/llvm/llvm-project/pull/155571
More information about the libcxx-commits
mailing list