Skip to content

Commit

Permalink
deduplicate coro detection code with warning suppression
Browse files Browse the repository at this point in the history
Reviewed By: apolloww

Differential Revision: D56389970

fbshipit-source-id: 62765923fd870488c2b0fb25c6dd0ac2240e41f6
  • Loading branch information
yfeldblum authored and facebook-github-bot committed Apr 22, 2024
1 parent e34b319 commit 1fec8f1
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions folly/experimental/coro/Coroutine.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,23 +225,19 @@ struct detect_promise_return_object_eager_conversion_ {

bool eager = false;

// FIXME: when building against Apple SDKs using c++17, we hit this all over
// the place on complex testing infrastructure for iOS. Since it's not clear
// how to fix the issue properly right now, force ignore this warnings and help
// unblock expected/optional coroutines. This should be removed once the build
// configuration is changed to use -Wno-deprecated-experimental-coroutine.
#if defined(__clang__) && (__clang_major__ < 17 && __clang_major__ > 13)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-experimental-coroutine"
static detect_promise_return_object_eager_conversion_ go() noexcept {
co_return;
}
#pragma clang diagnostic pop
#else
static detect_promise_return_object_eager_conversion_ go() noexcept {
// FIXME: when building against Apple SDKs using c++17, we hit this all over
// the place on complex testing infrastructure for iOS. Since it's not clear
// how to fix the issue properly right now, force ignore this warnings and
// unblock expected/optional coroutines. This should be removed once the
// build config is changed to use -Wno-deprecated-experimental-coroutine.
FOLLY_PUSH_WARNING
#if defined(__clang__) && (__clang_major__ < 17 && __clang_major__ > 13)
FOLLY_CLANG_DISABLE_WARNING("-Wdeprecated-experimental-coroutine")
#endif
co_return;
FOLLY_POP_WARNING
}
#endif
};

} // namespace detail
Expand Down

0 comments on commit 1fec8f1

Please sign in to comment.