From a5394a48fcd1bbc90759b21f492b3e69fa02bbbb Mon Sep 17 00:00:00 2001 From: Ben Deane Date: Tue, 4 Mar 2025 10:48:01 -0700 Subject: [PATCH] :alien: Fix clang-format changes from upstream --- include/stdx/atomic_bitset.hpp | 4 ++-- include/stdx/rollover.hpp | 8 ++++---- include/stdx/tuple.hpp | 2 +- test/fail/tuple_equality_with_element.cpp | 2 +- test/optional.cpp | 8 ++++---- test/tuple_algorithms.cpp | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/include/stdx/atomic_bitset.hpp b/include/stdx/atomic_bitset.hpp index 4cf5ccc..4f18a2f 100644 --- a/include/stdx/atomic_bitset.hpp +++ b/include/stdx/atomic_bitset.hpp @@ -1,7 +1,5 @@ #pragma once -#include - #include #include #include @@ -11,6 +9,8 @@ #include #include +#include + #include #include #include diff --git a/include/stdx/rollover.hpp b/include/stdx/rollover.hpp index 6e52e37..b560d05 100644 --- a/include/stdx/rollover.hpp +++ b/include/stdx/rollover.hpp @@ -75,10 +75,10 @@ template struct rollover_t { return not(lhs == rhs); } - constexpr friend auto operator<(rollover_t, rollover_t) -> bool = delete; - constexpr friend auto operator<=(rollover_t, rollover_t) -> bool = delete; - constexpr friend auto operator>(rollover_t, rollover_t) -> bool = delete; - constexpr friend auto operator>=(rollover_t, rollover_t) -> bool = delete; + friend constexpr auto operator<(rollover_t, rollover_t) -> bool = delete; + friend constexpr auto operator<=(rollover_t, rollover_t) -> bool = delete; + friend constexpr auto operator>(rollover_t, rollover_t) -> bool = delete; + friend constexpr auto operator>=(rollover_t, rollover_t) -> bool = delete; [[nodiscard]] constexpr friend auto cmp_less(rollover_t lhs, rollover_t rhs) -> bool { diff --git a/include/stdx/tuple.hpp b/include/stdx/tuple.hpp index a03135e..cef0692 100644 --- a/include/stdx/tuple.hpp +++ b/include/stdx/tuple.hpp @@ -499,7 +499,7 @@ template class one_of : public detail::tuple_impl, detail::index_function_list<>, Ts...> { template - constexpr friend auto operator==(one_of const &lhs, T const &rhs) -> bool { + friend constexpr auto operator==(one_of const &lhs, T const &rhs) -> bool { return lhs.apply( [&](auto &&...args) { return ((args == rhs) || ...); }); } diff --git a/test/fail/tuple_equality_with_element.cpp b/test/fail/tuple_equality_with_element.cpp index c4bd5ca..01e148b 100644 --- a/test/fail/tuple_equality_with_element.cpp +++ b/test/fail/tuple_equality_with_element.cpp @@ -3,7 +3,7 @@ // EXPECT: deleted struct S { - constexpr friend auto operator==(S, S) -> bool = default; + friend constexpr auto operator==(S, S) -> bool = default; }; auto main() -> int { diff --git a/test/optional.cpp b/test/optional.cpp index 679f370..c93f9ca 100644 --- a/test/optional.cpp +++ b/test/optional.cpp @@ -14,10 +14,10 @@ enum struct E : std::uint8_t { VALUE, ALT_VALUE }; struct S { constexpr explicit S(int i) : value{i} {} - constexpr friend auto operator==(S const &x, S const &y) -> bool { + friend constexpr auto operator==(S const &x, S const &y) -> bool { return x.value == y.value; } - constexpr friend auto operator<(S const &x, S const &y) -> bool { + friend constexpr auto operator<(S const &x, S const &y) -> bool { return x.value < y.value; } int value{}; @@ -332,7 +332,7 @@ struct move_only { constexpr move_only(int i) : value{i} {} constexpr move_only(move_only &&) = default; int value{}; - constexpr friend auto operator==(move_only const &x, move_only const &y) + friend constexpr auto operator==(move_only const &x, move_only const &y) -> bool { return x.value == y.value; } @@ -342,7 +342,7 @@ struct non_movable { constexpr non_movable(int i) : value{i} {} constexpr non_movable(non_movable &&) = delete; int value{}; - constexpr friend auto operator==(non_movable const &x, non_movable const &y) + friend constexpr auto operator==(non_movable const &x, non_movable const &y) -> bool { return x.value == y.value; } diff --git a/test/tuple_algorithms.cpp b/test/tuple_algorithms.cpp index e58602a..dffdb2c 100644 --- a/test/tuple_algorithms.cpp +++ b/test/tuple_algorithms.cpp @@ -337,7 +337,7 @@ TEST_CASE("fold_left (heterogeneous types in fold)", "[tuple_algorithms]") { } template struct addend { - constexpr friend auto operator==(addend, addend) -> bool { return true; } + friend constexpr auto operator==(addend, addend) -> bool { return true; } }; template constexpr auto operator+(addend, addend) { return addend{};