Add missing check against SemiFuture in FutureBase ctor
authorYedidya Feldblum <yfeldblum@fb.com>
Tue, 5 Dec 2017 04:57:02 +0000 (20:57 -0800)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 5 Dec 2017 05:04:44 +0000 (21:04 -0800)
Summary: [Folly] Add missing check against `SemiFuture` in `FutureBase` ctor.

Reviewed By: LeeHowes

Differential Revision: D6469021

fbshipit-source-id: 0ca31461afee4bf64725e065a8cb4d5e933d2013

folly/futures/Future.h

index e6fc8eb..5eda2c3 100644 (file)
@@ -59,7 +59,8 @@ class FutureBase {
   template <
       class T2 = T,
       typename = typename std::enable_if<
-          !isFuture<typename std::decay<T2>::type>::value>::type>
+          !isFuture<typename std::decay<T2>::type>::value &&
+          !isSemiFuture<typename std::decay<T2>::type>::value>::type>
   /* implicit */ FutureBase(T2&& val);
 
   template <class T2 = T>