diff options
author | Chris Lattner <sabre@nondot.org> | 2010-02-08 22:05:38 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2010-02-08 22:05:38 +0000 |
commit | cddc4c17b1140673ee5744a19d79b1dcaf9ea4ad (patch) | |
tree | f65f5aed5ff109291e0e9d9ff7f879e85b41d60e | |
parent | 9e60686a8378f7c6762f79d9a33f9a7c21321327 (diff) | |
download | bcm5719-llvm-cddc4c17b1140673ee5744a19d79b1dcaf9ea4ad.tar.gz bcm5719-llvm-cddc4c17b1140673ee5744a19d79b1dcaf9ea4ad.zip |
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).
llvm-svn: 95585
-rw-r--r-- | llvm/include/llvm/Support/Casting.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/include/llvm/Support/Casting.h b/llvm/include/llvm/Support/Casting.h index 37a7c3b02d4..17bcb599059 100644 --- a/llvm/include/llvm/Support/Casting.h +++ b/llvm/include/llvm/Support/Casting.h @@ -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> { // This _is_ a simple type, just cast it. static typename cast_retty<To, FromTy>::ret_type doit(const FromTy &Val) { - return reinterpret_cast<typename cast_retty<To, FromTy>::ret_type>( - const_cast<FromTy&>(Val)); + typename cast_retty<To, FromTy>::ret_type Res2 + = (typename cast_retty<To, FromTy>::ret_type)const_cast<FromTy&>(Val); + return Res2; } }; |