From 148df69fbab537463ea2a39276b60155b5c0d6bc Mon Sep 17 00:00:00 2001 From: Sargun Vohra Date: Mon, 7 Aug 2017 13:29:40 -0700 Subject: [PATCH] Don't allow Future::onError([](exception_wrapper&){}) to compile Summary: `Future::onError` does not work with a function that takes `exception_wrapper&`, so it should not compile. `exception_wrapper`, `const exception_wrapper&`, and `exception_wrapper&&` are unaffected. Reviewed By: yfeldblum Differential Revision: D5556083 fbshipit-source-id: 45d096d9fee00322eeec6b9b9b1dcbef55cced03 --- folly/futures/Future-inl.h | 2 ++ folly/futures/Future.h | 2 ++ 2 files changed, 4 insertions(+) diff --git a/folly/futures/Future-inl.h b/folly/futures/Future-inl.h index ef3048f4..6ba9b241 100644 --- a/folly/futures/Future-inl.h +++ b/folly/futures/Future-inl.h @@ -366,6 +366,7 @@ template template typename std::enable_if< !futures::detail::callableWith::value && + !futures::detail::callableWith::value && !futures::detail::Extract::ReturnsFuture::value, Future>::type Future::onError(F&& func) { @@ -398,6 +399,7 @@ template template typename std::enable_if< !futures::detail::callableWith::value && + !futures::detail::callableWith::value && futures::detail::Extract::ReturnsFuture::value, Future>::type Future::onError(F&& func) { diff --git a/folly/futures/Future.h b/folly/futures/Future.h index babaeb13..2d5d4cbc 100644 --- a/folly/futures/Future.h +++ b/folly/futures/Future.h @@ -262,6 +262,7 @@ class Future { template typename std::enable_if< !futures::detail::callableWith::value && + !futures::detail::callableWith::value && !futures::detail::Extract::ReturnsFuture::value, Future>::type onError(F&& func); @@ -270,6 +271,7 @@ class Future { template typename std::enable_if< !futures::detail::callableWith::value && + !futures::detail::callableWith::value && futures::detail::Extract::ReturnsFuture::value, Future>::type onError(F&& func); -- 2.34.1