mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-03-12 17:37:13 +00:00
use a c-style cast instead of reinterpret-cast, as sometimes the
cast needs to adjust for a vtable pointer when going from base to derived type (when the base doesn't have a vtable but the derived type does). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95585 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
15b423f772
commit
3a3134ab12
@ -180,8 +180,9 @@ template<class To, class From, class SimpleFrom> struct cast_convert_val {
|
|||||||
template<class To, class FromTy> struct cast_convert_val<To,FromTy,FromTy> {
|
template<class To, class FromTy> struct cast_convert_val<To,FromTy,FromTy> {
|
||||||
// This _is_ a simple type, just cast it.
|
// This _is_ a simple type, just cast it.
|
||||||
static typename cast_retty<To, FromTy>::ret_type doit(const FromTy &Val) {
|
static typename cast_retty<To, FromTy>::ret_type doit(const FromTy &Val) {
|
||||||
return reinterpret_cast<typename cast_retty<To, FromTy>::ret_type>(
|
typename cast_retty<To, FromTy>::ret_type Res2
|
||||||
const_cast<FromTy&>(Val));
|
= (typename cast_retty<To, FromTy>::ret_type)const_cast<FromTy&>(Val);
|
||||||
|
return Res2;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user