Skip to content

Commit 850a25c

Browse files
committed
fixes warnings and errors in clang16
1 parent 23ab4b8 commit 850a25c

File tree

2 files changed

+21
-17
lines changed

2 files changed

+21
-17
lines changed

include/exec/sequence/marbles.hpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -431,14 +431,15 @@ namespace exec {
431431
using __frame_t = typename _Clock::time_point;
432432
using __duration_t = typename _Clock::duration;
433433

434-
constexpr auto __make_span = []<std::size_t _LenB>(__mstring<_LenB>&& __string) noexcept {
435-
return std::span<char>{__string.__what_, _LenB - 1};
436-
};
434+
constexpr auto __make_span =
435+
[]<std::size_t _LenB>(const __mstring<_LenB>& __string) noexcept {
436+
return std::span<const char>{__string.__what_, _LenB - 1};
437+
};
437438

438439
std::vector<marble_t<_Clock>> __marbles;
439440
__frame_t __group_start_frame{-1ms};
440441
__frame_t __frame = __clock.now();
441-
auto __whole = __make_span(std::move(__diagram));
442+
auto __whole = __make_span(__diagram);
442443
auto __remaining = __whole;
443444
auto __consume_first = [&__remaining](std::size_t __skip) noexcept {
444445
__remaining = __remaining.subspan(__skip);
@@ -531,15 +532,18 @@ namespace exec {
531532
&& __all_digits) {
532533
auto __to_consume = __suffix_begin - __remaining.begin();
533534
long __duration = std::atol(__remaining.data());
534-
if (std::ranges::equal(
535-
__remaining.subspan(__to_consume, 3), __make_span("ms "_mstr))) {
535+
const auto __ms_str = "ms "_mstr;
536+
const auto __ms = __make_span(__ms_str);
537+
const auto __s_str = "s "_mstr;
538+
const auto __s = __make_span(__s_str);
539+
const auto __m_str = "m "_mstr;
540+
const auto __m = __make_span(__m_str);
541+
if (std::ranges::equal(__remaining.subspan(__to_consume, 3), __ms)) {
536542
__to_consume += 2;
537-
} else if (std::ranges::equal(
538-
__remaining.subspan(__to_consume, 2), __make_span("s "_mstr))) {
543+
} else if (std::ranges::equal(__remaining.subspan(__to_consume, 2), __s)) {
539544
__duration *= 1000;
540545
__to_consume += 1;
541-
} else if (std::ranges::equal(
542-
__remaining.subspan(__to_consume, 2), __make_span("m "_mstr))) {
546+
} else if (std::ranges::equal(__remaining.subspan(__to_consume, 2), __m)) {
543547
__duration = __duration * 1000 * 60;
544548
__to_consume += 1;
545549
} else {

include/exec/sequence/test_scheduler.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -826,7 +826,7 @@ namespace exec {
826826
exec::schedule_at(__self.__context_->get_scheduler(), __marble.frame()),
827827
static_cast<_Completion&&>(__completion)),
828828
stdexec::prop{stdexec::get_stop_token, __self.__stop_source_.get_token()})
829-
| stdexec::upon_error([](auto&&) noexcept {}) | stdexec::upon_stopped([]() noexcept {})
829+
| stdexec::upon_error([](auto&&) noexcept { }) | stdexec::upon_stopped([]() noexcept { })
830830
| stdexec::then([&__self, &__marble]() noexcept {
831831
// after each completion, update the __test_sequence_operation_part state
832832
STDEXEC_ASSERT(__self.__active_ops_ > 0);
@@ -869,10 +869,10 @@ namespace exec {
869869
decltype(__schedule_at(__self, __marble, stdexec::__declval<__next_t>()));
870870
using __end_sender_t = decltype(__schedule_at(__self, __marble, stdexec::just()));
871871
struct __next_sender_id {
872-
using __t = __next_sender_t;
872+
using __t [[maybe_unused]] = __next_sender_t;
873873
};
874874
struct __end_sender_id {
875-
using __t = __end_sender_t;
875+
using __t [[maybe_unused]] = __end_sender_t;
876876
};
877877

878878
// WORKAROUND clang 19 would fail to compile the construction of the variant_sender.
@@ -919,14 +919,14 @@ namespace exec {
919919
using __id = __test_sequence;
920920
using sender_concept = exec::sequence_sender_t;
921921

922-
using marble_t = marble_t<test_clock>;
923-
using marble_sender_t = marble_t::__marble_sender_t;
922+
using __marble_t = marble_t<test_clock>;
923+
using __marble_sender_t = __marble_t::__marble_sender_t;
924924

925925
test_context* __context_;
926-
std::vector<marble_t> __marbles_;
926+
std::vector<__marble_t> __marbles_;
927927

928928
template <stdexec::__decays_to<__test_sequence> _Self, class... _Env>
929-
static auto get_item_types(_Self&&, _Env&&...) noexcept -> item_types<marble_sender_t> {
929+
static auto get_item_types(_Self&&, _Env&&...) noexcept -> item_types<__marble_sender_t> {
930930
return {};
931931
}
932932

0 commit comments

Comments
 (0)