diff --git a/llvm/include/llvm/Support/FormatVariadicDetails.h b/llvm/include/llvm/Support/FormatVariadicDetails.h index fa11d56fc1ada..4002caf76675c 100644 --- a/llvm/include/llvm/Support/FormatVariadicDetails.h +++ b/llvm/include/llvm/Support/FormatVariadicDetails.h @@ -78,15 +78,14 @@ template class has_StreamOperator { using ConstRefT = const std::decay_t &; template - static char test(std::enable_if_t< - std::is_same_v() - << std::declval()), - llvm::raw_ostream &>, - int *>); + static auto test(int) + -> std::is_same() + << std::declval()), + llvm::raw_ostream &>; - template static double test(...); + template static auto test(...) -> std::false_type; - static bool const value = (sizeof(test(nullptr)) == 1); + static constexpr bool value = decltype(test(0))::value; }; // Simple template that decides whether a type T should use the member-function