diff --git a/llvm/lib/IR/Metadata.cpp b/llvm/lib/IR/Metadata.cpp index fc78a5b299f49..dc1651462aef4 100644 --- a/llvm/lib/IR/Metadata.cpp +++ b/llvm/lib/IR/Metadata.cpp @@ -986,15 +986,11 @@ static T *uniquifyImpl(T *N, DenseSet &Store) { } template struct MDNode::HasCachedHash { - using Yes = char[1]; - using No = char[2]; - template struct SFINAE {}; - template - static Yes &check(SFINAE *); - template static No &check(...); + static std::true_type check(SameType *); + template static std::false_type check(...); - static const bool value = sizeof(check(nullptr)) == sizeof(Yes); + static constexpr bool value = decltype(check(nullptr))::value; }; MDNode *MDNode::uniquify() {