Skip to content

Commit

Permalink
fixed a number of gcc warnings (and hopefully an error)
Browse files Browse the repository at this point in the history
  • Loading branch information
dietmarkuehl committed Dec 21, 2024
1 parent 059d7df commit ab3a204
Show file tree
Hide file tree
Showing 14 changed files with 35 additions and 35 deletions.
2 changes: 1 addition & 1 deletion include/beman/execution26/detail/basic_sender.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ struct basic_sender : ::beman::execution26::detail::product_type<Tag, Data, Chil
}
#else
template <::beman::execution26::detail::decays_to<basic_sender> Self, ::beman::execution26::receiver Receiver>
auto connect(this Self&& self, Receiver receiver) && noexcept(
auto connect(this Self&& self, Receiver receiver) noexcept(
noexcept(::beman::execution26::detail::basic_operation<basic_sender, Receiver>{::std::forward<Self>(self),
::std::move(receiver)}))
-> ::beman::execution26::detail::basic_operation<Self, Receiver> {
Expand Down
4 changes: 2 additions & 2 deletions include/beman/execution26/detail/basic_state.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ namespace beman::execution26::detail {
*/
template <typename Sender, typename Receiver>
struct basic_state {
basic_state(Sender&& sender, Receiver&& receiver) noexcept(true)
: receiver(::std::move(receiver)),
basic_state(Sender&& sender, Receiver&& rcvr) noexcept(true)
: receiver(::std::move(rcvr)),
state(::beman::execution26::detail::impls_for< ::beman::execution26::tag_of_t<Sender> >::get_state(
::std::forward<Sender>(sender), this->receiver)) {}

Expand Down
2 changes: 1 addition & 1 deletion include/beman/execution26/detail/fwd_env.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class fwd_env {
Env env;

public:
explicit fwd_env(Env&& env) : env(::std::forward<Env>(env)) {}
explicit fwd_env(Env&& e) : env(::std::forward<Env>(e)) {}

template <typename Query, typename... Args>
requires(not::beman::execution26::forwarding_query(::std::remove_cvref_t<Query>()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ struct get_completion_signatures_t {
private:
template <typename Sender, typename Env>
static auto get(Sender&& sender, Env&& env) noexcept {
auto new_sender{[](auto&& sender, auto&& env) -> decltype(auto) {
return ::beman::execution26::transform_sender(::beman::execution26::detail::get_domain_late(sender, env),
::std::forward<Sender>(sender),
::std::forward<Env>(env));
auto new_sender{[](auto&& sndr, auto&& e) -> decltype(auto) {
auto domain{::beman::execution26::detail::get_domain_late(sndr, e)};
return ::beman::execution26::transform_sender(domain,
::std::forward<Sender>(sndr),
::std::forward<Env>(e));
}};

using sender_type = ::std::remove_cvref_t<decltype(new_sender(sender, env))>;
Expand Down
2 changes: 1 addition & 1 deletion include/beman/execution26/detail/inplace_stop_source.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class beman::execution26::inplace_stop_token {
friend class ::beman::execution26::inplace_stop_source;
template <typename CallbackFun>
friend class ::beman::execution26::inplace_stop_callback;
explicit inplace_stop_token(::beman::execution26::inplace_stop_source* source) : source(source) {}
explicit inplace_stop_token(::beman::execution26::inplace_stop_source* src) : source(src) {}

::beman::execution26::inplace_stop_source* source{};
};
Expand Down
2 changes: 1 addition & 1 deletion include/beman/execution26/detail/join_env.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class join_env {

public:
template <typename E1, typename E2>
join_env(E1&& env1, E2&& env2) : env1(::std::forward<E1>(env1)), env2(::std::forward<E2>(env2)) {}
join_env(E1&& e1, E2&& e2) : env1(::std::forward<E1>(e1)), env2(::std::forward<E2>(e2)) {}

template <typename Query, typename... Args>
requires(
Expand Down
2 changes: 1 addition & 1 deletion include/beman/execution26/detail/make_env.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class make_env {

public:
template <typename V>
make_env(const Query&, V&& value) : value(::std::forward<V>(value)) {}
make_env(const Query&, V&& v) : value(::std::forward<V>(v)) {}
constexpr auto query(const Query&) const noexcept -> const Value& { return this->value; }
constexpr auto query(const Query&) noexcept -> Value& { return this->value; }
};
Expand Down
4 changes: 2 additions & 2 deletions include/beman/execution26/detail/notify.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ struct impls_for<::beman::execution26::detail::notify_t> : ::beman::execution26:
struct state : ::beman::execution26::detail::notifier::base {
::beman::execution26::detail::notifier* n;
::std::remove_cvref_t<Receiver>& receiver{};
state(::beman::execution26::detail::notifier* n, ::std::remove_cvref_t<Receiver>& receiver)
: n(n), receiver(receiver) {}
state(::beman::execution26::detail::notifier* nn, ::std::remove_cvref_t<Receiver>& rcvr)
: n(nn), receiver(rcvr) {}
auto complete() -> void override { ::beman::execution26::set_value(::std::move(this->receiver)); }
};
static constexpr auto get_state{[]<typename Sender, typename Receiver>(Sender&& sender, Receiver&& receiver) {
Expand Down
4 changes: 2 additions & 2 deletions include/beman/execution26/detail/operation_state_task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ struct connect_awaitable_promise;
template <typename Receiver>
struct beman::execution26::detail::connect_awaitable_promise
: ::beman::execution26::detail::with_await_transform<connect_awaitable_promise<Receiver>> {
connect_awaitable_promise(auto&&, Receiver& receiver) noexcept : receiver(receiver) {}
connect_awaitable_promise(auto&&, Receiver& rcvr) noexcept : receiver(rcvr) {}
auto initial_suspend() noexcept -> ::std::suspend_always { return {}; }
[[noreturn]] auto final_suspend() noexcept -> ::std::suspend_always { ::std::terminate(); }
[[noreturn]] auto unhandled_exception() noexcept -> void { ::std::terminate(); }
Expand Down Expand Up @@ -56,7 +56,7 @@ struct beman::execution26::detail::operation_state_task {
using operation_state_concept = ::beman::execution26::operation_state_t;
using promise_type = ::beman::execution26::detail::connect_awaitable_promise<Receiver>;

explicit operation_state_task(::std::coroutine_handle<> handle) noexcept : handle(handle) {}
explicit operation_state_task(::std::coroutine_handle<> hndl) noexcept : handle(hndl) {}
operation_state_task(const operation_state_task&) = delete;
operation_state_task(operation_state_task&& other) noexcept : handle(::std::exchange(other.handle, {})) {}
~operation_state_task() {
Expand Down
2 changes: 1 addition & 1 deletion include/beman/execution26/detail/run_loop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class run_loop {
Receiver receiver;

template <typename R>
opstate(run_loop* loop, R&& receiver) : loop(loop), receiver(::std::forward<Receiver>(receiver)) {}
opstate(run_loop* l, R&& rcvr) : loop(l), receiver(::std::forward<Receiver>(rcvr)) {}
auto start() & noexcept -> void {
try {
this->loop->push_back(this);
Expand Down
2 changes: 1 addition & 1 deletion include/beman/execution26/detail/sched_attrs.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class sched_attrs {

public:
template <typename S>
explicit sched_attrs(S sched) : sched(::std::move(sched)) {}
explicit sched_attrs(S s) : sched(::std::move(s)) {}

template <typename Tag>
auto query(const ::beman::execution26::get_completion_scheduler_t<Tag>&) const noexcept {
Expand Down
6 changes: 3 additions & 3 deletions include/beman/execution26/detail/simple_counting_scope.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ class beman::execution26::simple_counting_scope::assoc {

private:
friend class beman::execution26::simple_counting_scope::token;
explicit assoc(beman::execution26::simple_counting_scope* scope)
: scope(scope ? scope->try_associate() : nullptr) {}
explicit assoc(beman::execution26::simple_counting_scope* scp)
: scope(scp ? scp->try_associate() : nullptr) {}
beman::execution26::simple_counting_scope* scope{};
};
// NOLINTEND(misc-unconventional-assign-operator,hicpp-special-member-functions)
Expand All @@ -139,7 +139,7 @@ class beman::execution26::simple_counting_scope::token {

private:
friend class beman::execution26::simple_counting_scope;
explicit token(beman::execution26::simple_counting_scope* scope) noexcept : scope(scope) {}
explicit token(beman::execution26::simple_counting_scope* scp) noexcept : scope(scp) {}
beman::execution26::simple_counting_scope* scope;
};

Expand Down
4 changes: 2 additions & 2 deletions include/beman/execution26/detail/stop_source.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ inline auto beman::execution26::detail::stop_callback_base::deregister() -> void

inline auto beman::execution26::detail::stop_callback_base::call() -> void { this->do_call(); }

inline beman::execution26::stop_token::stop_token(::std::shared_ptr<::beman::execution26::detail::stop_state> state)
: state(::std::move(state)) {}
inline beman::execution26::stop_token::stop_token(::std::shared_ptr<::beman::execution26::detail::stop_state> st)
: state(::std::move(st)) {}

inline auto beman::execution26::stop_token::swap(stop_token& other) noexcept -> void { this->state.swap(other.state); }

Expand Down
25 changes: 12 additions & 13 deletions tests/beman/execution26/exec-connect.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ struct state {
std::remove_cvref_t<Receiver> receiver;

template <typename R>
state(int value, R&& r) : value(value), receiver(std::forward<R>(r)) {}
state(int val, R&& r) : value(val), receiver(std::forward<R>(r)) {}
state(const state&) = delete;
state(state&&) = delete;
~state() = default;
Expand All @@ -45,7 +45,7 @@ struct rvalue_sender {
using sender_concept = test_std::sender_t;
int value{};

explicit rvalue_sender(int value) : value(value) {}
explicit rvalue_sender(int val) : value(val) {}
rvalue_sender(const rvalue_sender&) = delete;
rvalue_sender(rvalue_sender&&) = default;
auto operator=(const rvalue_sender&) -> rvalue_sender& = delete;
Expand All @@ -67,8 +67,8 @@ struct receiver {
int value{};
bool* set_stopped_called{};

explicit receiver(int value, bool* set_stopped_called = {})
: value(value), set_stopped_called(set_stopped_called) {}
explicit receiver(int val, bool* called = {})
: value(val), set_stopped_called(called) {}
receiver(receiver&&) = default;
receiver(const receiver&) = delete;
~receiver() = default;
Expand Down Expand Up @@ -104,7 +104,7 @@ struct domain_receiver {
using receiver_concept = test_std::receiver_t;
int value{};

explicit domain_receiver(int value) : value(value) {}
explicit domain_receiver(int val) : value(val) {}
domain_receiver(domain_receiver&&) = default;
domain_receiver(const domain_receiver&) = delete;
~domain_receiver() = default;
Expand Down Expand Up @@ -167,7 +167,6 @@ auto test_operation_state_task() -> void {
static_assert(
std::same_as<::beman::execution26::detail::connect_awaitable_promise<receiver>, state_t::promise_type>);
static_assert(noexcept(state_t(std::coroutine_handle<>{})));
static_assert(noexcept(state_t(state_t(std::coroutine_handle<>{}))));
state_t state(::std::coroutine_handle<>{});
static_assert(noexcept(state.start()));
}
Expand Down Expand Up @@ -201,7 +200,7 @@ auto test_suspend_complete() -> void {
}

auto test_connect_awaitable() -> void {
struct awaiter {
struct local_awaiter {
::std::coroutine_handle<>& handle;
int& result;

Expand All @@ -225,7 +224,7 @@ auto test_connect_awaitable() -> void {
auto await_resume() -> void {}
};

struct receiver {
struct local_receiver {
using receiver_concept = test_std::receiver_t;

int& iv;
Expand Down Expand Up @@ -253,7 +252,7 @@ auto test_connect_awaitable() -> void {
int iv{};
bool bv{};

auto op1{test_detail::connect_awaitable(awaiter{handle, result}, receiver{iv, bv})};
auto op1{test_detail::connect_awaitable(local_awaiter{handle, result}, local_receiver{iv, bv})};
ASSERT(handle == std::coroutine_handle<>());
op1.start();
ASSERT(handle != std::coroutine_handle<>());
Expand All @@ -269,7 +268,7 @@ auto test_connect_awaitable() -> void {
int iv{};
bool bv{};

auto op1{test_detail::connect_awaitable(awaiter{handle, result}, receiver{iv, bv})};
auto op1{test_detail::connect_awaitable(local_awaiter{handle, result}, local_receiver{iv, bv})};
ASSERT(handle == std::coroutine_handle<>());
op1.start();
ASSERT(handle != std::coroutine_handle<>());
Expand All @@ -285,7 +284,7 @@ auto test_connect_awaitable() -> void {
int iv{};
bool bv{};

auto op1{test_detail::connect_awaitable(void_awaiter{handle}, receiver{iv, bv})};
auto op1{test_detail::connect_awaitable(void_awaiter{handle}, local_receiver{iv, bv})};
ASSERT(handle == std::coroutine_handle<>());
op1.start();
ASSERT(handle != std::coroutine_handle<>());
Expand All @@ -302,7 +301,7 @@ auto test_connect_with_awaiter() -> void {
auto await_suspend(std::coroutine_handle<> h) -> void { this->handle = h; }
auto await_resume() -> int { return 17; }
};
struct receiver {
struct local_receiver {
using receiver_concept = test_std::receiver_t;
bool& result;
auto set_value(int i) && noexcept -> void { this->result = i == 17; }
Expand All @@ -312,7 +311,7 @@ auto test_connect_with_awaiter() -> void {

std::coroutine_handle<> handle{};
bool result{};
auto op{test_std::connect(awaiter{handle}, receiver{result})};
auto op{test_std::connect(awaiter{handle}, local_receiver{result})};
ASSERT(handle == std::coroutine_handle{});
test_std::start(op);
ASSERT(handle != std::coroutine_handle{});
Expand Down

0 comments on commit ab3a204

Please sign in to comment.