Skip to content

Commit

Permalink
[ADT] Avoid use of result_of_t in function_ref
Browse files Browse the repository at this point in the history
It has bugs on some old libc++ versions and we don't need the power.
See https://reviews.llvm.org/D88977
  • Loading branch information
sam-mccall committed Oct 19, 2020
1 parent c872faf commit 375f7a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions llvm/include/llvm/ADT/STLExtras.h
Expand Up @@ -199,9 +199,9 @@ class function_ref<Ret(Params...)> {
function_ref>::value> * = nullptr,
// Functor must be callable and return a suitable type.
std::enable_if_t<std::is_void<Ret>::value ||
std::is_convertible<
std::result_of_t<Callable(Params...)>, Ret>::value>
* = nullptr)
std::is_convertible<decltype(std::declval<Callable>()(
std::declval<Params>()...)),
Ret>::value> * = nullptr)
: callback(callback_fn<typename std::remove_reference<Callable>::type>),
callable(reinterpret_cast<intptr_t>(&callable)) {}

Expand Down

0 comments on commit 375f7a4

Please sign in to comment.