Author: Kazu Hirata Date: 2022-10-15T14:59:23-07:00 New Revision: e323a904dce5bf248affef811791f4f8d4d45f02
URL: https://github.com/llvm/llvm-project/commit/e323a904dce5bf248affef811791f4f8d4d45f02 DIFF: https://github.com/llvm/llvm-project/commit/e323a904dce5bf248affef811791f4f8d4d45f02.diff LOG: [clangd] Use std::decay_t (NFC) Added: Modified: clang-tools-extra/clangd/support/Context.h clang-tools-extra/clangd/support/Function.h Removed: ################################################################################ diff --git a/clang-tools-extra/clangd/support/Context.h b/clang-tools-extra/clangd/support/Context.h index 926add18d88aa..2f403aebd3bba 100644 --- a/clang-tools-extra/clangd/support/Context.h +++ b/clang-tools-extra/clangd/support/Context.h @@ -155,7 +155,7 @@ class Context { }; template <class T> class TypedAnyStorage : public Context::AnyStorage { - static_assert(std::is_same<typename std::decay<T>::type, T>::value, + static_assert(std::is_same<std::decay_t<T>, T>::value, "Argument to TypedAnyStorage must be decayed"); public: @@ -200,7 +200,7 @@ class [[nodiscard]] WithContext { class [[nodiscard]] WithContextValue { public: template <typename T> - WithContextValue(const Key<T> &K, typename std::decay<T>::type V) + WithContextValue(const Key<T> &K, std::decay_t<T> V) : Restore(Context::current().derive(K, std::move(V))) {} // Anonymous values can be used for the destructor side-effect. diff --git a/clang-tools-extra/clangd/support/Function.h b/clang-tools-extra/clangd/support/Function.h index dc9216bc53753..5437729d91b62 100644 --- a/clang-tools-extra/clangd/support/Function.h +++ b/clang-tools-extra/clangd/support/Function.h @@ -93,7 +93,7 @@ template <typename T> class Event { } private: - static_assert(std::is_same<typename std::decay<T>::type, T>::value, + static_assert(std::is_same<std::decay_t<T>, T>::value, "use a plain type: event values are always passed by const&"); std::recursive_mutex ListenersMu; _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits