Skip to content

Commit 7d60e9c

Browse files
committed
more clang-tidy fixes
1 parent c9fb7b3 commit 7d60e9c

File tree

3 files changed

+15
-11
lines changed

3 files changed

+15
-11
lines changed

include/beman/execution26/detail/product_type.hpp

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,18 +48,17 @@ struct product_type_base<::std::index_sequence<I...>, T...>
4848
}
4949
template <::std::size_t J>
5050
auto get() const& -> decltype(auto) {
51-
return this->element_get<J>(::std::move(*this));
51+
return this->element_get<J>(*this);
5252
}
5353

5454
template <::std::size_t J, typename Allocator, typename Self>
5555
static auto make_element(Allocator&& alloc, Self&& self) -> decltype(auto) {
56-
using type = ::std::remove_cvref_t<decltype(std::forward<Self>(self).template element_get<J>(
57-
std::forward<Self>(self)))>;
56+
using type = ::std::remove_cvref_t<decltype(product_type_base::element_get<J>(std::forward<Self>(self)))>;
5857
if constexpr (::std::uses_allocator_v<type, Allocator>)
59-
return ::std::make_obj_using_allocator<type>(
60-
alloc, std::forward<Self>(self).template element_get<J>(std::forward<Self>(self)));
58+
return ::std::make_obj_using_allocator<type>(alloc,
59+
product_type_base::element_get<J>(std::forward<Self>(self)));
6160
else
62-
return std::forward<Self>(self).template element_get<J>(std::forward<Self>(self));
61+
return product_type_base::element_get<J>(std::forward<Self>(self));
6362
}
6463

6564
auto operator==(const product_type_base&) const -> bool = default;
@@ -69,8 +68,7 @@ template <typename... T>
6968
struct product_type : ::beman::execution26::detail::product_type_base<::std::index_sequence_for<T...>, T...> {
7069
template <typename Allocator, typename Product, std::size_t... I>
7170
static auto make_from(Allocator&& allocator, Product&& product, std::index_sequence<I...>) -> product_type {
72-
return {
73-
::std::forward<Product>(product).template make_element<I>(allocator, ::std::forward<Product>(product))...};
71+
return {product_type::template make_element<I>(allocator, ::std::forward<Product>(product))...};
7472
}
7573

7674
template <typename Allocator, typename Product>

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

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@
1717
namespace {
1818
struct not_movable {
1919
not_movable() = default;
20+
not_movable(const not_movable&) = delete;
2021
not_movable(not_movable&&) = delete;
22+
~not_movable() = default;
23+
auto operator=(const not_movable&) -> not_movable& = delete;
24+
auto operator=(not_movable&&) -> not_movable& = delete;
2125
};
2226
template <bool Expect, typename Completion, typename CPO, typename... T>
2327
auto test_just_constraints(CPO const& cpo, T&&... args) -> void {
@@ -60,7 +64,7 @@ auto test_just_constraints() -> void {
6064
template <typename... T>
6165
struct value_receiver {
6266
using receiver_concept = test_std::receiver_t;
63-
bool* called;
67+
bool* called{};
6468
test_detail::product_type<std::decay_t<T>...> expect{};
6569

6670
template <typename... A>
@@ -206,7 +210,7 @@ TEST(exec_just) {
206210
test_just();
207211
test_just_allocator();
208212
} catch (...) {
209-
ASSERT(nullptr ==
210-
"the just tests shouldn't throw"); // NOLINT(cert-dcl03-c,hicpp-static-assert,misc-static-assert)
213+
// NOLINTNEXTLINE(cert-dcl03-c,hicpp-static-assert,misc-static-assert)
214+
ASSERT(nullptr == "the just tests shouldn't throw");
211215
}
212216
}

tests/beman/execution26/stoptoken-inplace-members.test.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include "test/execution.hpp"
55

6+
namespace {
67
auto test_inplace_stop_token_swap() -> void {
78
// Plan:
89
// - Given two inplace_stop_token objects which don't compare equal but
@@ -69,6 +70,7 @@ auto test_inplace_stop_token_stop_possible() -> void {
6970
ASSERT(connected.stop_possible() == true);
7071
ASSERT(disconnected.stop_requested() == false);
7172
}
73+
} // namespace
7274

7375
TEST(stoptoken_inplace_members) {
7476
test_inplace_stop_token_swap();

0 commit comments

Comments
 (0)