Skip to content

Commit 68eaa37

Browse files
committed
more clang-tidy fixes
1 parent 5f5ff20 commit 68eaa37

33 files changed

+191
-74
lines changed

include/beman/execution26/detail/basic_operation.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,11 @@ template <typename Sender, typename Receiver>
3838
basic_operation(Sender&& sender, Receiver&& receiver) noexcept(true /*-dk:TODO*/)
3939
: ::beman::execution26::detail::basic_state<Sender, Receiver>(::std::forward<Sender>(sender),
4040
::std::move(receiver)),
41+
// NOLINTBEGIN(bugprone-use-after-move,hicpp-invalid-access-moved)
42+
//-dk:TODO deal with moving the sender twice
4143
inner_ops(::beman::execution26::detail::connect_all(
4244
this, ::std::forward<Sender>(sender), ::beman::execution26::detail::indices_for<Sender>())) {}
45+
// NOLINTEND(bugprone-use-after-move,hicpp-invalid-access-moved)
4346

4447
private:
4548
auto start() & noexcept -> void {

include/beman/execution26/detail/basic_sender.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ struct basic_sender : ::beman::execution26::detail::product_type<Tag, Data, Chil
4242
template <typename Receiver>
4343
requires(not::beman::execution26::receiver<Receiver>)
4444
auto connect(Receiver receiver) = BEMAN_EXECUTION26_DELETE("the passed receiver doesn't model receiver");
45+
4546
private:
4647
#if __cpp_explicit_this_parameter < 202110L
4748
template <::beman::execution26::receiver Receiver>

include/beman/execution26/detail/notify.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313

1414
namespace beman::execution26::detail {
1515
struct notify_t;
16-
class notifier
17-
: ::beman::execution26::detail::immovable {
16+
class notifier : ::beman::execution26::detail::immovable {
1817
public:
1918
auto complete() -> void {
2019
::std::unique_lock kerberos(this->lock);

include/beman/execution26/detail/product_type.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ struct product_type : ::beman::execution26::detail::product_type_base<::std::ind
7575

7676
template <typename Allocator, typename Product>
7777
static auto make_from(Allocator&& allocator, Product&& product) -> product_type {
78-
return std::forward<Product>(product).make_from(
78+
return product_type::make_from(
7979
::std::forward<Allocator>(allocator), ::std::forward<Product>(product), ::std::index_sequence_for<T...>{});
8080
}
8181

include/beman/execution26/detail/simple_counting_scope.hpp

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ class simple_counting_scope;
2020

2121
// ----------------------------------------------------------------------------
2222

23-
class beman::execution26::simple_counting_scope
24-
: ::beman::execution26::detail::immovable {
23+
class beman::execution26::simple_counting_scope : ::beman::execution26::detail::immovable {
2524
public:
2625
class token;
2726
class assoc;
@@ -58,7 +57,15 @@ class beman::execution26::simple_counting_scope
5857
}
5958

6059
private:
61-
enum class state_t: unsigned char { unused, open, open_and_joining, closed, closed_and_joining, unused_and_closed, joined };
60+
enum class state_t : unsigned char {
61+
unused,
62+
open,
63+
open_and_joining,
64+
closed,
65+
closed_and_joining,
66+
unused_and_closed,
67+
joined
68+
};
6269
friend class assoc;
6370
auto try_associate() noexcept -> simple_counting_scope* {
6471
::std::lock_guard lock(this->mutex);
@@ -90,7 +97,7 @@ class beman::execution26::simple_counting_scope
9097

9198
// ----------------------------------------------------------------------------
9299

93-
// NOLINTBEGIN(misc-unconventional-assign-operator)
100+
// NOLINTBEGIN(misc-unconventional-assign-operator,hicpp-special-member-functions)
94101
class beman::execution26::simple_counting_scope::assoc {
95102
public:
96103
assoc() = default;
@@ -114,7 +121,7 @@ class beman::execution26::simple_counting_scope::assoc {
114121
: scope(scope ? scope->try_associate() : nullptr) {}
115122
beman::execution26::simple_counting_scope* scope{};
116123
};
117-
// NOLINTEND(misc-unconventional-assign-operator)
124+
// NOLINTEND(misc-unconventional-assign-operator,hicpp-special-member-functions)
118125

119126
// ----------------------------------------------------------------------------
120127

include/beman/execution26/detail/starts_on.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,8 @@ struct starts_on_t {
4343

4444
template <::beman::execution26::scheduler Scheduler, ::beman::execution26::sender Sender>
4545
auto operator()(Scheduler&& scheduler, Sender&& sender) const {
46-
auto domain{::beman::execution26::detail::query_with_default(::beman::execution26::get_domain,
47-
::std::forward<Scheduler>(scheduler),
48-
::beman::execution26::default_domain{})};
46+
auto domain{::beman::execution26::detail::query_with_default(
47+
::beman::execution26::get_domain, scheduler, ::beman::execution26::default_domain{})};
4948
return ::beman::execution26::transform_sender(
5049
domain,
5150
::beman::execution26::detail::make_sender(

tests/beman/execution26/allocator-requirements-general.test.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,12 @@ struct deallocate_size_type_mismatch {
6565
struct not_copy_constructible {
6666
using value_type = int;
6767

68-
not_copy_constructible(const not_copy_constructible&) = delete;
68+
not_copy_constructible() = default;
69+
not_copy_constructible(not_copy_constructible&&) = delete;
70+
not_copy_constructible(const not_copy_constructible&) = delete;
71+
~not_copy_constructible() = default;
72+
auto operator=(not_copy_constructible&&) -> not_copy_constructible = delete;
73+
auto operator=(const not_copy_constructible&) -> not_copy_constructible = delete;
6974
auto allocate(::std::size_t n) -> int* { return new int[n]; }
7075
auto deallocate(/*long*/ int*, ::std::size_t) -> void {}
7176

tests/beman/execution26/exec-connect.test.cpp

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,11 @@ struct state {
2323

2424
template <typename R>
2525
state(int value, R&& r) : value(value), receiver(std::forward<R>(r)) {}
26+
state(const state&) = delete;
2627
state(state&&) = delete;
27-
~state() = default;
28+
~state() = default;
29+
auto operator=(const state&) -> state& = delete;
30+
auto operator=(state&&) -> state& = delete;
2831
auto start() noexcept -> void {}
2932
};
3033

@@ -43,8 +46,11 @@ struct rvalue_sender {
4346
int value{};
4447

4548
explicit rvalue_sender(int value) : value(value) {}
49+
rvalue_sender(const rvalue_sender&) = delete;
4650
rvalue_sender(rvalue_sender&&) = default;
47-
auto operator=(rvalue_sender&&) -> rvalue_sender& = default;
51+
auto operator=(const rvalue_sender&) -> rvalue_sender& = delete;
52+
auto operator=(rvalue_sender&&) -> rvalue_sender& = default;
53+
~rvalue_sender() = default;
4854

4955
template <typename Receiver>
5056
auto connect(Receiver&& receiver) && -> state<kind::plain, Receiver> {
@@ -64,7 +70,10 @@ struct receiver {
6470
explicit receiver(int value, bool* set_stopped_called = {})
6571
: value(value), set_stopped_called(set_stopped_called) {}
6672
receiver(receiver&&) = default;
73+
receiver(const receiver&) = delete;
74+
~receiver() = default;
6775
auto operator=(receiver&&) -> receiver& = default;
76+
auto operator=(const receiver&) -> receiver& = delete;
6877
auto operator==(const receiver&) const -> bool = default;
6978

7079
auto get_env() const noexcept -> env { return {this->value + 2}; }
@@ -97,7 +106,10 @@ struct domain_receiver {
97106

98107
explicit domain_receiver(int value) : value(value) {}
99108
domain_receiver(domain_receiver&&) = default;
100-
auto operator=(domain_receiver&&) -> domain_receiver& = default;
109+
domain_receiver(const domain_receiver&) = delete;
110+
~domain_receiver() = default;
111+
auto operator=(domain_receiver&&) -> domain_receiver& = default;
112+
auto operator=(const domain_receiver&) -> domain_receiver& = delete;
101113

102114
auto operator==(const domain_receiver&) const -> bool = default;
103115

tests/beman/execution26/exec-general.test.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ auto test_movable_value() -> void {
2929

3030
static_assert(not test_detail::movable_value<non_movable>);
3131
static_assert(not test_detail::movable_value<const non_copyable>);
32-
static_assert(not test_detail::movable_value<int[1]>);
33-
static_assert(not test_detail::movable_value<int(&)[1]>);
32+
static_assert(not test_detail::movable_value<int[1]>); // NOLINT(hicpp-avoid-c-arrays)
33+
static_assert(not test_detail::movable_value<int(&)[1]>); // NOLINT(hicpp-avoid-c-arrays)
3434
}
3535

3636
auto test_matching_sig() -> void {

tests/beman/execution26/exec-just.test.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,17 @@ auto test_just_allocator() -> void {
196196
} // namespace
197197

198198
TEST(exec_just) {
199-
test_just_constraints();
200-
test_just();
201-
test_just_allocator();
199+
202200
using type = test_detail::
203201
call_result_t<test_std::get_completion_signatures_t, decltype(test_std::just()), test_std::empty_env>;
204202

205203
static_assert(std::same_as<test_std::completion_signatures<test_std::set_value_t()>, type>);
204+
try {
205+
test_just_constraints();
206+
test_just();
207+
test_just_allocator();
208+
} catch (...) {
209+
ASSERT(nullptr ==
210+
"the just tests shouldn't throw"); // NOLINT(cert-dcl03-c,hicpp-static-assert,misc-static-assert)
211+
}
206212
}

0 commit comments

Comments
 (0)