Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions llvm/include/llvm/Support/FormatVariadicDetails.h
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,14 @@ template <class T> class has_StreamOperator {
using ConstRefT = const std::decay_t<T> &;

template <typename U>
static char test(std::enable_if_t<
std::is_same_v<decltype(std::declval<llvm::raw_ostream &>()
<< std::declval<U>()),
llvm::raw_ostream &>,
int *>);
static auto test(int)
-> std::is_same<decltype(std::declval<llvm::raw_ostream &>()
<< std::declval<U>()),
llvm::raw_ostream &>;

template <typename U> static double test(...);
template <typename U> static auto test(...) -> std::false_type;

static bool const value = (sizeof(test<ConstRefT>(nullptr)) == 1);
static constexpr bool value = decltype(test<ConstRefT>(0))::value;
};

// Simple template that decides whether a type T should use the member-function
Expand Down