diff --git a/folly/futures/Future-inl.h b/folly/futures/Future-inl.h index 8a577bade6b..bcf76ff58f9 100644 --- a/folly/futures/Future-inl.h +++ b/folly/futures/Future-inl.h @@ -2140,14 +2140,16 @@ SemiFuture SemiFuture::within( return std::move(*this); } - struct Context : futures::detail::WithinContextBase { - using Base = futures::detail::WithinContextBase; - static void goPromiseSetException(Base& base, exception_wrapper&& e) { + using ContextBase = futures::detail::WithinContextBase; + struct Context : ContextBase { + static void goPromiseSetException( + ContextBase& base, exception_wrapper&& e) { static_cast(base).promise.setException(std::move(e)); } Promise promise; explicit Context(E ex) - : Base(goPromiseSetException, exception_wrapper(std::move(ex))) {} + : ContextBase(goPromiseSetException, exception_wrapper(std::move(ex))) { + } }; std::shared_ptr tks;