Skip to content

Commit 5b19463

Browse files
[Support] Use std::is_convertible_v (NFC)
1 parent c5a69ae commit 5b19463

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/include/llvm/Support/Error.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ template <class T> class [[nodiscard]] Expected {
508508
/// must be convertible to T.
509509
template <typename OtherT>
510510
Expected(OtherT &&Val,
511-
std::enable_if_t<std::is_convertible<OtherT, T>::value> * = nullptr)
511+
std::enable_if_t<std::is_convertible_v<OtherT, T>> * = nullptr)
512512
: HasError(false)
513513
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
514514
// Expected is unchecked upon construction in Debug builds.
@@ -525,9 +525,8 @@ template <class T> class [[nodiscard]] Expected {
525525
/// Move construct an Expected<T> value from an Expected<OtherT>, where OtherT
526526
/// must be convertible to T.
527527
template <class OtherT>
528-
Expected(
529-
Expected<OtherT> &&Other,
530-
std::enable_if_t<std::is_convertible<OtherT, T>::value> * = nullptr) {
528+
Expected(Expected<OtherT> &&Other,
529+
std::enable_if_t<std::is_convertible_v<OtherT, T>> * = nullptr) {
531530
moveConstruct(std::move(Other));
532531
}
533532

@@ -536,7 +535,7 @@ template <class T> class [[nodiscard]] Expected {
536535
template <class OtherT>
537536
explicit Expected(
538537
Expected<OtherT> &&Other,
539-
std::enable_if_t<!std::is_convertible<OtherT, T>::value> * = nullptr) {
538+
std::enable_if_t<!std::is_convertible_v<OtherT, T>> * = nullptr) {
540539
moveConstruct(std::move(Other));
541540
}
542541

0 commit comments

Comments
 (0)