Skip to content

Commit

Permalink
don't use <ranges> for clang<=15 & libstdc++ (#1003)
Browse files Browse the repository at this point in the history
The combination of clang <= 15 and libstdc++'s version of <ranges> runs into llvm/llvm-project#44178.
  • Loading branch information
ericniebler authored Jul 18, 2023
1 parent e9b4e69 commit db31763
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/exec/sequence/test_iterate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
*/

#include "exec/sequence/iterate.hpp"
#include "stdexec/execution.hpp"

#ifdef __cpp_lib_ranges
// Before clang-16, clang did not like libstdc++'s ranges implementation
#if defined(__cpp_lib_ranges) && \
(!STDEXEC_CLANG() || __clang_major__ >= 16 || defined(_LIBCPP_VERSION))

#include <array>
#include <catch2/catch.hpp>

template <class Receiver>
Expand Down Expand Up @@ -94,7 +98,7 @@ struct sum_receiver {
TEST_CASE("iterate - sum up an array ", "[sequence_senders][iterate]") {
std::array<int, 3> array{42, 43, 44};
int sum = 0;
auto iterate = exec::iterate(std::ranges::views::all(array));
auto iterate = exec::iterate(std::views::all(array));
STATIC_REQUIRE(exec::sequence_sender_in<decltype(iterate), stdexec::empty_env>);
auto op = exec::subscribe(iterate, sum_receiver{sum});
stdexec::start(op);
Expand Down

0 comments on commit db31763

Please sign in to comment.