Skip to content

Commit 8e9547c

Browse files
committed
Workaround MSVC bug.
1 parent 67740ab commit 8e9547c

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

include/stdexec/__detail/__bulk.hpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -219,10 +219,14 @@ namespace stdexec {
219219
__shape_t __begin,
220220
__shape_t __end,
221221
auto&&... __vs) mutable //
222-
noexcept(noexcept(__data.__fun_(__begin++, __vs...))) {
223-
while (__begin != __end)
224-
__func(__begin++, __vs...);
225-
};
222+
#if !STDEXEC_MSVC()
223+
// MSVCBUG https://developercommunity.visualstudio.com/t/noexcept-expression-in-lambda-template-n/10718680
224+
noexcept(noexcept(__data.__fun_(__begin++, __vs...)))
225+
#endif
226+
{
227+
while (__begin != __end)
228+
__func(__begin++, __vs...);
229+
};
226230

227231
// Lower `bulk` to `bulk_chunked`. If `bulk_chunked` is customized, we will see the customization.
228232
return bulk_chunked(

test/stdexec/algos/adaptors/test_bulk.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ namespace {
148148
error_scheduler sched2{};
149149
error_scheduler<int> sched3{43};
150150

151+
#if !STDEXEC_MSVC()
152+
// MSVCBUG https://developercommunity.visualstudio.com/t/noexcept-expression-in-lambda-template-n/10718680
151153
check_err_types<ex::__mset<>>( //
152154
ex::transfer_just(sched1) | ex::bulk(ex::par, n, [](int) noexcept { }));
153155
check_err_types<ex::__mset<std::exception_ptr>>( //
@@ -158,6 +160,7 @@ namespace {
158160
ex::transfer_just(sched3) | ex::bulk(ex::par, n, [](int) noexcept { }));
159161
check_err_types<ex::__mset<std::exception_ptr, int>>( //
160162
ex::transfer_just(sched3) | ex::bulk(ex::par, n, [](int) { throw std::logic_error{"err"}; }));
163+
#endif
161164
}
162165

163166
TEST_CASE("bulk_chunked keeps error_types from input sender", "[adaptors][bulk]") {

0 commit comments

Comments
 (0)