From: Sargun Vohra Date: Mon, 7 Aug 2017 20:29:40 +0000 (-0700) Subject: Don't allow Future::onError([](exception_wrapper&){}) to compile X-Git-Tag: v2017.08.14.00~7 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=148df69fbab537463ea2a39276b60155b5c0d6bc;p=folly.git 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 --- 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);