[llvm] [Support] Fix up cast function object definitions. NFC. (PR #166789)
Jakub Kuderski via llvm-commits
llvm-commits at lists.llvm.org
Thu Nov 6 07:59:06 PST 2025
https://github.com/kuhar created https://github.com/llvm/llvm-project/pull/166789
The template arguments specify the *target* type, not the *source* type.
>From c7dc8d8bceb2aebefdb887129915edb69bfd8d88 Mon Sep 17 00:00:00 2001
From: Jakub Kuderski <jakub at nod-labs.com>
Date: Thu, 6 Nov 2025 10:57:46 -0500
Subject: [PATCH] [Support] Fix up cast function object definitions. NFC.
The template arguments specify the *target* type, not the *source* type.
---
llvm/include/llvm/Support/Casting.h | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
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