aboutsummaryrefslogtreecommitdiff
path: root/include/llvm/Support/Casting.h
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-11-16 20:21:15 +0000
committerChris Lattner <sabre@nondot.org>2003-11-16 20:21:15 +0000
commit8b70b78ba489b090d9866e6a4084ab1e8613b527 (patch)
treec3e137b779b119b92587950176b457381132b18f /include/llvm/Support/Casting.h
parentf3b2410bc4c098c0f27f689c797a539d6ef8a09e (diff)
Fixes for PR114: Thanks to Reid Spencer!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10029 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Support/Casting.h')
-rw-r--r--include/llvm/Support/Casting.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/llvm/Support/Casting.h b/include/llvm/Support/Casting.h
index 4b070c18d8..abc80aac7a 100644
--- a/include/llvm/Support/Casting.h
+++ b/include/llvm/Support/Casting.h
@@ -37,7 +37,7 @@ template<typename From> struct simplify_type {
template<typename From> struct simplify_type<const From> {
typedef const From SimpleType;
static SimpleType &getSimplifiedValue(const From &Val) {
- return simplify_type<From>::getSimplifiedValue((From&)Val);
+ return simplify_type<From>::getSimplifiedValue(static_cast<From&>(Val));
}
};
@@ -178,7 +178,8 @@ template<class To, class From, class SimpleFrom> struct cast_convert_val {
template<class To, class FromTy> struct cast_convert_val<To,FromTy,FromTy> {
// This _is_ a simple type, just cast it.
static typename cast_retty<To, FromTy>::ret_type doit(const FromTy &Val) {
- return (typename cast_retty<To, FromTy>::ret_type)Val;
+ return reinterpret_cast<typename cast_retty<To, FromTy>::ret_type>(
+ const_cast<FromTy&>(Val));
}
};