diff --git a/llvm/include/llvm/Support/FormatVariadicDetails.h b/llvm/include/llvm/Support/FormatVariadicDetails.h index b85a4f6065195..1879a9844030c 100644 --- a/llvm/include/llvm/Support/FormatVariadicDetails.h +++ b/llvm/include/llvm/Support/FormatVariadicDetails.h @@ -66,13 +66,10 @@ template class has_FormatProvider { typedef void (*Signature_format)(const Decayed &, llvm::raw_ostream &, StringRef); - template - static char test(SameType *); - - template static double test(...); + template using check = SameType; - static bool const value = - (sizeof(test>(nullptr)) == 1); + static constexpr bool value = + llvm::is_detected>::value; }; // Test if raw_ostream& << T -> raw_ostream& is findable via ADL.