Skip to content

Commit 4a51b0c

Browse files
committed
[ADT] Remove is_invocable from STLExtras.h
As a follow-up of https://reviews.llvm.org/D132318, now that the callers have been adjusted to use `std::is_invocable`, remove `llvm::is_invocable` and its tests. Differential Revision: https://reviews.llvm.org/D132321
1 parent 7e2cf26 commit 4a51b0c

File tree

2 files changed

+0
-23
lines changed

2 files changed

+0
-23
lines changed

llvm/include/llvm/ADT/STLExtras.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -96,16 +96,6 @@ struct detector<std::void_t<Op<Args...>>, Op, Args...> {
9696
template <template <class...> class Op, class... Args>
9797
using is_detected = typename detail::detector<void, Op, Args...>::value_t;
9898

99-
namespace detail {
100-
template <typename Callable, typename... Args>
101-
using is_invocable =
102-
decltype(std::declval<Callable &>()(std::declval<Args>()...));
103-
} // namespace detail
104-
105-
/// Check if a Callable type can be invoked with the given set of arg types.
106-
template <typename Callable, typename... Args>
107-
using is_invocable = is_detected<detail::is_invocable, Callable, Args...>;
108-
10999
/// This class provides various trait information about a callable object.
110100
/// * To access the number of arguments: Traits::num_args
111101
/// * To access the type of an argument: Traits::arg_t<Index>

llvm/unittests/ADT/TypeTraitsTest.cpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,3 @@ static_assert(is_detected<has_foo_method_t, HasFooMethod>::value,
6464
static_assert(!is_detected<has_foo_method_t, NoFooMethod>::value,
6565
"expected no foo method to be detected");
6666
} // end anonymous namespace
67-
68-
//===----------------------------------------------------------------------===//
69-
// is_invocable
70-
//===----------------------------------------------------------------------===//
71-
72-
void invocable_fn(int);
73-
74-
static_assert(is_invocable<decltype(invocable_fn), int>::value,
75-
"expected function to be invocable");
76-
static_assert(!is_invocable<decltype(invocable_fn), void *>::value,
77-
"expected function not to be invocable");
78-
static_assert(!is_invocable<decltype(invocable_fn), int, int>::value,
79-
"expected function not to be invocable");

0 commit comments

Comments
 (0)