From 812fb35ea44905810f1cbb0f4322fca4499b4f26 Mon Sep 17 00:00:00 2001 From: Kazu Hirata Date: Sun, 14 Sep 2025 00:38:01 -0700 Subject: [PATCH] [Support] Use llvm::is_detected (NFC) This patch uses llvm::is_detected to replace the old SFINAE-based approach. --- llvm/include/llvm/Support/FormatVariadicDetails.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) 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.