From 69021b69d9b3cfaa14b2a522be32de529bd73a06 Mon Sep 17 00:00:00 2001 From: Yedidya Feldblum Date: Tue, 23 Jul 2024 17:59:31 -0700 Subject: [PATCH] fix weird compile error in SemiFuture::within Summary: Blames to {D60095691}. ``` folly/futures/Future-inl.h:2144:11: error: unused type alias 'Base' [-Werror,-Wunused-local-typedef] using Base = futures::detail::WithinContextBase; ^ ``` Reviewed By: Gownta Differential Revision: D60146633 fbshipit-source-id: 8307635dfa22de7d9c7752da5c330dba661a6303 --- folly/futures/Future-inl.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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;