diff --git a/libcxx/include/__algorithm/ranges_merge.h b/libcxx/include/__algorithm/ranges_merge.h --- a/libcxx/include/__algorithm/ranges_merge.h +++ b/libcxx/include/__algorithm/ranges_merge.h @@ -107,7 +107,7 @@ _OutIter, _Comp, _Proj1, - _Proj2> + _Proj2> _LIBCPP_HIDE_FROM_ABI constexpr merge_result, borrowed_iterator_t<_Range2>, _OutIter> operator()( _Range1&& __range1, diff --git a/libcxx/include/__algorithm/ranges_set_difference.h b/libcxx/include/__algorithm/ranges_set_difference.h --- a/libcxx/include/__algorithm/ranges_set_difference.h +++ b/libcxx/include/__algorithm/ranges_set_difference.h @@ -71,7 +71,7 @@ class _Comp = less, class _Proj1 = identity, class _Proj2 = identity> - requires mergeable, iterator_t<_Range2>, _OutIter, _Comp, _Proj1, _Proj2> + requires mergeable, iterator_t<_Range2>, _OutIter, _Comp, _Proj1, _Proj2> _LIBCPP_HIDE_FROM_ABI constexpr set_difference_result, _OutIter> operator()( _Range1&& __range1, diff --git a/libcxx/include/__algorithm/ranges_set_intersection.h b/libcxx/include/__algorithm/ranges_set_intersection.h --- a/libcxx/include/__algorithm/ranges_set_intersection.h +++ b/libcxx/include/__algorithm/ranges_set_intersection.h @@ -82,7 +82,7 @@ _OutIter, _Comp, _Proj1, - _Proj2> + _Proj2> _LIBCPP_HIDE_FROM_ABI constexpr set_intersection_result, borrowed_iterator_t<_Range2>, _OutIter> diff --git a/libcxx/include/__algorithm/ranges_set_symmetric_difference.h b/libcxx/include/__algorithm/ranges_set_symmetric_difference.h --- a/libcxx/include/__algorithm/ranges_set_symmetric_difference.h +++ b/libcxx/include/__algorithm/ranges_set_symmetric_difference.h @@ -81,7 +81,7 @@ _OutIter, _Comp, _Proj1, - _Proj2> + _Proj2> _LIBCPP_HIDE_FROM_ABI constexpr set_symmetric_difference_result, borrowed_iterator_t<_Range2>, _OutIter> diff --git a/libcxx/include/__algorithm/ranges_set_union.h b/libcxx/include/__algorithm/ranges_set_union.h --- a/libcxx/include/__algorithm/ranges_set_union.h +++ b/libcxx/include/__algorithm/ranges_set_union.h @@ -84,7 +84,7 @@ _OutIter, _Comp, _Proj1, - _Proj2> + _Proj2> _LIBCPP_HIDE_FROM_ABI constexpr set_union_result, borrowed_iterator_t<_Range2>, _OutIter> diff --git a/libcxx/include/__support/solaris/xlocale.h b/libcxx/include/__support/solaris/xlocale.h --- a/libcxx/include/__support/solaris/xlocale.h +++ b/libcxx/include/__support/solaris/xlocale.h @@ -43,7 +43,7 @@ } inline _LIBCPP_HIDE_FROM_ABI unsigned long long -strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t __loc) +strtoull_l(const char *__nptr, char **__endptr, int __base, locale_t __loc) return ::strtoull(__nptr, __endptr, __base); } diff --git a/libcxx/include/new b/libcxx/include/new --- a/libcxx/include/new +++ b/libcxx/include/new @@ -164,7 +164,7 @@ public: bad_array_new_length() noexcept : bad_alloc("bad array new length") {} }; -#endif // defined(_LIBCPP_ABI_VCRUNTIME) && defined(_HAS_EXCEPTIONS) &&_HAS_EXCEPTIONS == 0 +#endif // defined(_LIBCPP_ABI_VCRUNTIME) && defined(_HAS_EXCEPTIONS) && _HAS_EXCEPTIONS == 0 _LIBCPP_NORETURN _LIBCPP_FUNC_VIS void __throw_bad_alloc(); // not in C++ spec diff --git a/libcxx/src/support/ibm/wcsnrtombs.cpp b/libcxx/src/support/ibm/wcsnrtombs.cpp --- a/libcxx/src/support/ibm/wcsnrtombs.cpp +++ b/libcxx/src/support/ibm/wcsnrtombs.cpp @@ -14,7 +14,7 @@ // Converts `max_source_chars` from the wide character buffer pointer to by *`src`, // into the multi byte character sequence buffer stored at `dst`, which must be // `dst_size_bytes` bytes in size. Returns the number of bytes in the sequence -// converted from *src, excluding the null terminator. +// converted from *src, excluding the null terminator. // Returns (size_t) -1 if an error occurs and sets errno. // If `dst` is NULL, `dst_size_bytes` is ignored and no bytes are copied to `dst`. _LIBCPP_FUNC_VIS diff --git a/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/ranges.move.pass.cpp b/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/ranges.move.pass.cpp --- a/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/ranges.move.pass.cpp +++ b/libcxx/test/std/algorithms/alg.modifying.operations/alg.move/ranges.move.pass.cpp @@ -155,7 +155,7 @@ assert(b[2].get() == 3); } } - + { // check that a move-only type works for ProxyIterator { MoveOnly a[] = {1, 2, 3}; diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/ranges_set_intersection.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/ranges_set_intersection.pass.cpp --- a/libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/ranges_set_intersection.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.intersection/ranges_set_intersection.pass.cpp @@ -568,8 +568,8 @@ // Cannot static_assert on the entire permutation test because it exceeds the constexpr execution step limit // due to the large number of combination of types of iterators (it is a 3-dimensional cartesian product) - // Instead of having one single static_assert that tests all the combinations, in the runAllIteratorPermutationsTests - // function, it has lots of smaller static_assert and each of them test 2-dimensional cartesian product which is less + // Instead of having one single static_assert that tests all the combinations, in the runAllIteratorPermutationsTests + // function, it has lots of smaller static_assert and each of them test 2-dimensional cartesian product which is less // than the step limit. runAllIteratorPermutationsTests(); diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.union/ranges_set_union.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.union/ranges_set_union.pass.cpp --- a/libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.union/ranges_set_union.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.set.operations/set.union/ranges_set_union.pass.cpp @@ -488,7 +488,7 @@ assert(compProjs.numberOfProj2 < maxOperation); } } - + return true; } diff --git a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/ranges.sort.pass.cpp b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/ranges.sort.pass.cpp --- a/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/ranges.sort.pass.cpp +++ b/libcxx/test/std/algorithms/alg.sorting/alg.sort/sort/ranges.sort.pass.cpp @@ -224,7 +224,7 @@ } } */ - + return true; } diff --git a/libcxx/test/std/algorithms/alg.sorting/sortable_helpers.h b/libcxx/test/std/algorithms/alg.sorting/sortable_helpers.h --- a/libcxx/test/std/algorithms/alg.sorting/sortable_helpers.h +++ b/libcxx/test/std/algorithms/alg.sorting/sortable_helpers.h @@ -17,7 +17,7 @@ #include #include #include "test_iterators.h" -#endif +#endif struct TrivialSortable { int value; @@ -112,7 +112,7 @@ // TODO: some algorithms calls std::__copy // std::__copy(contiguous_iterator, sentinel_wrapper>, contiguous_iterator) doesn't seem to work. - // It seems that it unwraps contiguous_iterator into int*, and then it failed because there is no == between int* and + // It seems that it unwraps contiguous_iterator into int*, and then it failed because there is no == between int* and // sentinel_wrapper> using Sent = std::conditional_t, Iter, sentinel_wrapper>; diff --git a/libcxx/test/std/ranges/range.adaptors/range.all/all.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.all/all.pass.cpp --- a/libcxx/test/std/ranges/range.adaptors/range.all/all.pass.cpp +++ b/libcxx/test/std/ranges/range.adaptors/range.all/all.pass.cpp @@ -151,8 +151,8 @@ static_assert(!std::is_invocable_v); static_assert(!std::is_invocable_v); - // `views::all(v)` is expression equivalent to `decay-copy(v)` if the decayed type - // of `v` models `view`. If `v` is an lvalue-reference to a move-only view, the + // `views::all(v)` is expression equivalent to `decay-copy(v)` if the decayed type + // of `v` models `view`. If `v` is an lvalue-reference to a move-only view, the // expression should be ill-formed because `v` is not copyable static_assert(!std::is_invocable_v); } diff --git a/libcxx/test/std/ranges/range.adaptors/range.join.view/end.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.join.view/end.pass.cpp --- a/libcxx/test/std/ranges/range.adaptors/range.join.view/end.pass.cpp +++ b/libcxx/test/std/ranges/range.adaptors/range.join.view/end.pass.cpp @@ -74,7 +74,7 @@ std::ranges::join_view jv(outer); assert(jv.end() == std::ranges::next(jv.begin(), 12)); assert(std::as_const(jv).end() == std::ranges::next(std::as_const(jv).begin(), 12)); - + static_assert(HasConstEnd); static_assert(std::same_as); static_assert(!std::ranges::common_range); @@ -162,7 +162,7 @@ std::ranges::join_view jv(outer); assert(jv.end() == std::ranges::next(jv.begin(), 12)); assert(std::as_const(jv).end() == std::ranges::next(std::as_const(jv).begin(), 12)); - + static_assert(HasConstEnd); static_assert(!std::same_as); static_assert(!std::ranges::common_range); diff --git a/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/iter.move.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/iter.move.pass.cpp --- a/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/iter.move.pass.cpp +++ b/libcxx/test/std/ranges/range.adaptors/range.join.view/iterator/iter.move.pass.cpp @@ -28,7 +28,7 @@ } { - // iter_move calls inner's iter_move and calls + // iter_move calls inner's iter_move and calls // iter_move on the correct inner iterator IterMoveSwapAwareView inners[2] = {buffer[0], buffer[1]}; std::ranges::join_view jv(inners); diff --git a/libcxx/test/std/ranges/range.adaptors/range.join.view/types.h b/libcxx/test/std/ranges/range.adaptors/range.join.view/types.h --- a/libcxx/test/std/ranges/range.adaptors/range.join.view/types.h +++ b/libcxx/test/std/ranges/range.adaptors/range.join.view/types.h @@ -364,7 +364,7 @@ struct move_swap_aware_iter { - // This is a proxy-like iterator where `reference` is a prvalue, and + // This is a proxy-like iterator where `reference` is a prvalue, and // `reference` and `value_type` are distinct types (similar to `zip_view::iterator`). using value_type = std::pair; using reference = std::pair; diff --git a/libcxx/test/std/ranges/range.adaptors/range.zip/ctor.default.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.zip/ctor.default.pass.cpp --- a/libcxx/test/std/ranges/range.adaptors/range.zip/ctor.default.pass.cpp +++ b/libcxx/test/std/ranges/range.adaptors/range.zip/ctor.default.pass.cpp @@ -36,7 +36,7 @@ }; // The default constructor requires all underlying views to be default constructible. -// It is implicitly required by the tuple's constructor. If any of the iterators are +// It is implicitly required by the tuple's constructor. If any of the iterators are // not default constructible, zip iterator's =default would be implicitly deleted. static_assert(std::is_default_constructible_v>); static_assert( diff --git a/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/arithmetic.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/arithmetic.pass.cpp --- a/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/arithmetic.pass.cpp +++ b/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/arithmetic.pass.cpp @@ -16,7 +16,7 @@ // x - n; // x - y; // All the arithmetic operators have the constraint `requires all-random-access;`, -// except `operator-(x, y)` which instead has the constraint +// except `operator-(x, y)` which instead has the constraint // `requires (sized_­sentinel_­for>, // iterator_t>> && ...);` diff --git a/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/ctor.default.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/ctor.default.pass.cpp --- a/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/ctor.default.pass.cpp +++ b/libcxx/test/std/ranges/range.adaptors/range.zip/iterator/ctor.default.pass.cpp @@ -57,7 +57,7 @@ auto [x] = *iter; assert(x == 0); // PODIter has to be initialised to have value 0 } - + { ZipIter iter = {}; auto [x] = *iter; diff --git a/libcxx/test/std/ranges/range.adaptors/range.zip/range.concept.compile.pass.cpp b/libcxx/test/std/ranges/range.adaptors/range.zip/range.concept.compile.pass.cpp --- a/libcxx/test/std/ranges/range.adaptors/range.zip/range.concept.compile.pass.cpp +++ b/libcxx/test/std/ranges/range.adaptors/range.zip/range.concept.compile.pass.cpp @@ -318,8 +318,8 @@ static_assert(!std::ranges::input_range); template -concept zippable = requires { - typename std::ranges::zip_view; +concept zippable = requires { + typename std::ranges::zip_view; }; // output_range is not supported diff --git a/libcxx/utils/ci/run-buildbot b/libcxx/utils/ci/run-buildbot --- a/libcxx/utils/ci/run-buildbot +++ b/libcxx/utils/ci/run-buildbot @@ -187,6 +187,9 @@ # Depends on LC_COLLATE set at the top of this script. ! grep -rn '[^ -~]' libcxx/include/ || false + # Reject code with trailing whitespace + ! grep -rn '[[:blank:]]$' libcxx/include libcxx/src libcxx/test || false + # Reject patches that introduce dependency cycles in the headers. python3 libcxx/utils/graph_header_deps.py >/dev/null ;;