Skip to content

Commit

Permalink
[Support] Use std::is_convertible_v (NFC)
Browse files Browse the repository at this point in the history
  • Loading branch information
kazutakahirata committed Nov 20, 2022
1 parent c5a69ae commit 5b19463
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions llvm/include/llvm/Support/Error.h
Expand Up @@ -508,7 +508,7 @@ template <class T> class [[nodiscard]] Expected {
/// must be convertible to T.
template <typename OtherT>
Expected(OtherT &&Val,
std::enable_if_t<std::is_convertible<OtherT, T>::value> * = nullptr)
std::enable_if_t<std::is_convertible_v<OtherT, T>> * = nullptr)
: HasError(false)
#if LLVM_ENABLE_ABI_BREAKING_CHECKS
// Expected is unchecked upon construction in Debug builds.
Expand All @@ -525,9 +525,8 @@ template <class T> class [[nodiscard]] Expected {
/// Move construct an Expected<T> value from an Expected<OtherT>, where OtherT
/// must be convertible to T.
template <class OtherT>
Expected(
Expected<OtherT> &&Other,
std::enable_if_t<std::is_convertible<OtherT, T>::value> * = nullptr) {
Expected(Expected<OtherT> &&Other,
std::enable_if_t<std::is_convertible_v<OtherT, T>> * = nullptr) {
moveConstruct(std::move(Other));
}

Expand All @@ -536,7 +535,7 @@ template <class T> class [[nodiscard]] Expected {
template <class OtherT>
explicit Expected(
Expected<OtherT> &&Other,
std::enable_if_t<!std::is_convertible<OtherT, T>::value> * = nullptr) {
std::enable_if_t<!std::is_convertible_v<OtherT, T>> * = nullptr) {
moveConstruct(std::move(Other));
}

Expand Down

0 comments on commit 5b19463

Please sign in to comment.