diff --git a/clang-tools-extra/clang-tidy/ClangTidyCheck.h b/clang-tools-extra/clang-tidy/ClangTidyCheck.h index 17e9df96c39be..39b9f9fa865b7 100644 --- a/clang-tools-extra/clang-tidy/ClangTidyCheck.h +++ b/clang-tools-extra/clang-tidy/ClangTidyCheck.h @@ -190,7 +190,7 @@ class ClangTidyCheck : public ast_matchers::MatchFinder::MatchCallback { /// If the corresponding key can't be parsed as a ``T``, emit a /// diagnostic and return ``std::nullopt``. template - std::enable_if_t::value, std::optional> + std::enable_if_t, std::optional> get(StringRef LocalName) const { if (std::optional Value = get(LocalName)) { T Result{}; @@ -211,8 +211,8 @@ class ClangTidyCheck : public ast_matchers::MatchFinder::MatchCallback { /// If the corresponding key can't be parsed as a ``T``, emit a /// diagnostic and return \p Default. template - std::enable_if_t::value, T> get(StringRef LocalName, - T Default) const { + std::enable_if_t, T> get(StringRef LocalName, + T Default) const { return get(LocalName).value_or(Default); } @@ -227,7 +227,7 @@ class ClangTidyCheck : public ast_matchers::MatchFinder::MatchCallback { /// If the corresponding key can't be parsed as a ``T``, emit a /// diagnostic and return ``std::nullopt``. template - std::enable_if_t::value, std::optional> + std::enable_if_t, std::optional> getLocalOrGlobal(StringRef LocalName) const { std::optional ValueOr = get(LocalName); bool IsGlobal = false; @@ -256,7 +256,7 @@ class ClangTidyCheck : public ast_matchers::MatchFinder::MatchCallback { /// If the corresponding key can't be parsed as a ``T``, emit a /// diagnostic and return \p Default. template - std::enable_if_t::value, T> + std::enable_if_t, T> getLocalOrGlobal(StringRef LocalName, T Default) const { return getLocalOrGlobal(LocalName).value_or(Default); } @@ -274,7 +274,7 @@ class ClangTidyCheck : public ast_matchers::MatchFinder::MatchCallback { /// \ref clang::tidy::OptionEnumMapping must be specialized for ``T`` to /// supply the mapping required to convert between ``T`` and a string. template - std::enable_if_t::value, std::optional> + std::enable_if_t, std::optional> get(StringRef LocalName, bool IgnoreCase = false) const { if (std::optional ValueOr = getEnumInt(LocalName, typeEraseMapping(), false, IgnoreCase)) @@ -295,8 +295,8 @@ class ClangTidyCheck : public ast_matchers::MatchFinder::MatchCallback { /// \ref clang::tidy::OptionEnumMapping must be specialized for ``T`` to /// supply the mapping required to convert between ``T`` and a string. template - std::enable_if_t::value, T> - get(StringRef LocalName, T Default, bool IgnoreCase = false) const { + std::enable_if_t, T> get(StringRef LocalName, T Default, + bool IgnoreCase = false) const { return get(LocalName, IgnoreCase).value_or(Default); } @@ -314,7 +314,7 @@ class ClangTidyCheck : public ast_matchers::MatchFinder::MatchCallback { /// \ref clang::tidy::OptionEnumMapping must be specialized for ``T`` to /// supply the mapping required to convert between ``T`` and a string. template - std::enable_if_t::value, std::optional> + std::enable_if_t, std::optional> getLocalOrGlobal(StringRef LocalName, bool IgnoreCase = false) const { if (std::optional ValueOr = getEnumInt(LocalName, typeEraseMapping(), true, IgnoreCase)) @@ -336,7 +336,7 @@ class ClangTidyCheck : public ast_matchers::MatchFinder::MatchCallback { /// \ref clang::tidy::OptionEnumMapping must be specialized for ``T`` to /// supply the mapping required to convert between ``T`` and a string. template - std::enable_if_t::value, T> + std::enable_if_t, T> getLocalOrGlobal(StringRef LocalName, T Default, bool IgnoreCase = false) const { return getLocalOrGlobal(LocalName, IgnoreCase).value_or(Default); @@ -350,7 +350,7 @@ class ClangTidyCheck : public ast_matchers::MatchFinder::MatchCallback { /// Stores an option with the check-local name \p LocalName with /// integer value \p Value to \p Options. template - std::enable_if_t::value> + std::enable_if_t> store(ClangTidyOptions::OptionMap &Options, StringRef LocalName, T Value) const { storeInt(Options, LocalName, Value); @@ -362,7 +362,7 @@ class ClangTidyCheck : public ast_matchers::MatchFinder::MatchCallback { /// \ref clang::tidy::OptionEnumMapping must be specialized for ``T`` to /// supply the mapping required to convert between ``T`` and a string. template - std::enable_if_t::value> + std::enable_if_t> store(ClangTidyOptions::OptionMap &Options, StringRef LocalName, T Value) const { ArrayRef> Mapping = @@ -383,7 +383,7 @@ class ClangTidyCheck : public ast_matchers::MatchFinder::MatchCallback { bool CheckGlobal, bool IgnoreCase) const; template - std::enable_if_t::value, std::vector> + std::enable_if_t, std::vector> typeEraseMapping() const { ArrayRef> Mapping = OptionEnumMapping::getEnumMapping(); diff --git a/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp b/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp index d8c7c52ba89ac..e2c2dad6cf323 100644 --- a/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp +++ b/clang-tools-extra/clang-tidy/bugprone/EasilySwappableParametersCheck.cpp @@ -518,9 +518,9 @@ struct Mix { }; // NOLINTNEXTLINE(misc-redundant-expression): Seems to be a bogus warning. -static_assert(std::is_trivially_copyable::value && - std::is_trivially_move_constructible::value && - std::is_trivially_move_assignable::value, +static_assert(std::is_trivially_copyable_v && + std::is_trivially_move_constructible_v && + std::is_trivially_move_assignable_v, "Keep frequently used data simple!"); struct MixableParameterRange {