Skip to content

Commit 7c94dbb

Browse files
author
git apple-llvm automerger
committed
Merge commit '7d949ee04f98' from llvm.org/main into next
2 parents 75c0f3e + 7d949ee commit 7c94dbb

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

llvm/include/llvm/Support/FormatVariadicDetails.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,13 +66,10 @@ template <class T> class has_FormatProvider {
6666
typedef void (*Signature_format)(const Decayed &, llvm::raw_ostream &,
6767
StringRef);
6868

69-
template <typename U>
70-
static char test(SameType<Signature_format, &U::format> *);
71-
72-
template <typename U> static double test(...);
69+
template <typename U> using check = SameType<Signature_format, &U::format>;
7370

74-
static bool const value =
75-
(sizeof(test<llvm::format_provider<Decayed>>(nullptr)) == 1);
71+
static constexpr bool value =
72+
llvm::is_detected<check, llvm::format_provider<Decayed>>::value;
7673
};
7774

7875
// Test if raw_ostream& << T -> raw_ostream& is findable via ADL.

0 commit comments

Comments
 (0)