Skip to content

Commit 7b0c45f

Browse files
yuxuanchen1997facebook-github-bot
authored andcommitted
add attr to co_awaitTry
Summary: This diff is actually a missing part of D67299322, which is landed omitting this change. Considering that `co_awaitTry` is similar to `co_nothrow`, this should be safe. This change has been ready before the break but I didn't land it due to code freeze/safety concerns. Reviewed By: yfeldblum, skrueger Differential Revision: D68108268 fbshipit-source-id: 1157448ec1840b089509a242630fe78cf21385cb
1 parent 477fd6c commit 7b0c45f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

folly/coro/ViaIfAsync.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -750,15 +750,15 @@ template <
750750
typename Awaitable,
751751
std::enable_if_t<!is_must_await_immediately_v<Awaitable>, int> = 0>
752752
detail::TryAwaitable<remove_cvref_t<Awaitable>> co_awaitTry(
753-
Awaitable&& awaitable) {
753+
[[FOLLY_ATTR_CLANG_CORO_AWAIT_ELIDABLE_ARGUMENT]] Awaitable&& awaitable) {
754754
return detail::TryAwaitable<remove_cvref_t<Awaitable>>{
755755
static_cast<Awaitable&&>(awaitable)};
756756
}
757757
template <
758758
typename Awaitable,
759759
std::enable_if_t<is_must_await_immediately_v<Awaitable>, int> = 0>
760760
detail::TryAwaitable<remove_cvref_t<Awaitable>> co_awaitTry(
761-
Awaitable awaitable) {
761+
[[FOLLY_ATTR_CLANG_CORO_AWAIT_ELIDABLE_ARGUMENT]] Awaitable awaitable) {
762762
return detail::TryAwaitable<remove_cvref_t<Awaitable>>{
763763
std::move(awaitable).unsafeMoveMustAwaitImmediately()};
764764
}

0 commit comments

Comments
 (0)