Enable exceptions on serialization of out-of-range ints
[hiphop-php.git] / patches / shipit-folly-D19351227.patch
bloba27ce6593ed0d552634f62ec8740f50fde4498c0
1 From D19351227-96525515 Mon Sep 17 00:00:00 2001
2 From: Ján . <jjergus@fb.com>
3 Date: Fri, 10 Jan 2020 12:47:26 -0800
4 Subject: [PATCH] fix is_nothrow_invocable for GCC 6
6 Summary:
7 In GCC 6's stdlib, `std::invoke` is missing a `noexcept` declaration (it's fixed in GCC 8), so this doesn't work.
9 I think we can probably just skip `invoke` here completely to avoid the issue...? Since all we care about is the `invoke`'s `noexcept` declaration anyway.
11 Differential Revision: D19351227
12 ---
14 diff --git a/third-party/folly/src/folly/functional/Invoke.h b/third-party/folly/src/folly/functional/Invoke.h
15 --- a/third-party/folly/src/folly/functional/Invoke.h
16 +++ b/third-party/folly/src/folly/functional/Invoke.h
17 @@ -103,8 +103,8 @@
19 template <typename F, typename... Args>
20 struct invoke_nothrow_
21 - : bool_constant<noexcept(
22 - invoke(std::declval<F>(), std::declval<Args>()...))> {};
23 + : bool_constant<noexcept(static_cast<F&&>(std::declval<F>())(
24 + static_cast<Args&&>(std::declval<Args>())...))> {};
26 // from: http://en.cppreference.com/w/cpp/types/result_of, CC-BY-SA
29 1.7.9.5