Commit a3ab5485 authored by Ruslan Sayfutdinov's avatar Ruslan Sayfutdinov Committed by Facebook GitHub Bot

fix internal clang errors on Windows

Summary: Fix clang internal error on Windows.

Reviewed By: yfeldblum

Differential Revision: D26994868

fbshipit-source-id: 97fe79231fcbfc0fc6712626dee8e1d570dd0dd6
parent 01f86817
......@@ -507,8 +507,12 @@ auto collectAllTryRange(InputRange awaitables)
executor.get_alias(),
co_withCancellation(cancelToken, std::move(semiAwaitable))));
}
// This causes "Instruction does not dominate all uses!" internal compiler
// error on Windows with Clang.
#if !(defined(_WIN32) && defined(__clang__))
} catch (const std::exception& ex) {
result.emplaceException(std::current_exception(), ex);
#endif
} catch (...) {
result.emplaceException(std::current_exception());
}
......
......@@ -360,8 +360,11 @@ class FOLLY_NODISCARD TaskWithExecutor {
detail::InlineTaskDetached startImpl(TaskWithExecutor task, F cb) {
try {
cb(co_await folly::coro::co_awaitTry(std::move(task)));
// This causes clang internal error on Windows.
#if !(defined(_WIN32) && defined(__clang__))
} catch (const std::exception& e) {
cb(Try<StorageType>(exception_wrapper(std::current_exception(), e)));
#endif
} catch (...) {
cb(Try<StorageType>(exception_wrapper(std::current_exception())));
}
......@@ -371,8 +374,11 @@ class FOLLY_NODISCARD TaskWithExecutor {
detail::InlineTaskDetached startInlineImpl(TaskWithExecutor task, F cb) {
try {
cb(co_await InlineTryAwaitable{std::exchange(task.coro_, {})});
// This causes clang internal error on Windows.
#if !(defined(_WIN32) && defined(__clang__))
} catch (const std::exception& e) {
cb(Try<StorageType>(exception_wrapper(std::current_exception(), e)));
#endif
} catch (...) {
cb(Try<StorageType>(exception_wrapper(std::current_exception())));
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment