[llvm] ba4abc6 - [Support] Fix up cast function object definitions. NFC. (#166789)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 6 08:55:10 PST 2025
Author: Jakub Kuderski
Date: 2025-11-06T16:55:06Z
New Revision: ba4abc61a1f53a80d0526ce5201d5b4e0b556025
URL: https://github.com/llvm/llvm-project/commit/ba4abc61a1f53a80d0526ce5201d5b4e0b556025
DIFF: https://github.com/llvm/llvm-project/commit/ba4abc61a1f53a80d0526ce5201d5b4e0b556025.diff
LOG: [Support] Fix up cast function object definitions. NFC. (#166789)
The template arguments specify the *target* type, not the *source* type.
Added:
Modified:
llvm/include/llvm/Support/Casting.h
Removed:
################################################################################
diff --git a/llvm/include/llvm/Support/Casting.h b/llvm/include/llvm/Support/Casting.h
index a6435a2562a2b..af283e2c8ada3 100644
--- a/llvm/include/llvm/Support/Casting.h
+++ b/llvm/include/llvm/Support/Casting.h
@@ -878,18 +878,18 @@ inline constexpr detail::IsaAndPresentCheckPredicate<Types...>
IsaAndPresentPred{};
/// Function objects corresponding to the Cast types defined above.
-template <typename From>
-inline constexpr detail::StaticCastFunc<From> StaticCastTo{};
+template <typename To>
+inline constexpr detail::StaticCastFunc<To> StaticCastTo{};
-template <typename From> inline constexpr detail::CastFunc<From> CastTo{};
+template <typename To> inline constexpr detail::CastFunc<To> CastTo{};
-template <typename From>
-inline constexpr detail::CastIfPresentFunc<From> CastIfPresentTo{};
+template <typename To>
+inline constexpr detail::CastIfPresentFunc<To> CastIfPresentTo{};
-template <typename From>
-inline constexpr detail::DynCastIfPresentFunc<From> DynCastIfPresentTo{};
+template <typename To>
+inline constexpr detail::DynCastIfPresentFunc<To> DynCastIfPresentTo{};
-template <typename From> inline constexpr detail::DynCastFunc<From> DynCastTo{};
+template <typename To> inline constexpr detail::DynCastFunc<To> DynCastTo{};
} // end namespace llvm
More information about the llvm-commits
mailing list