From: Chris Lattner Date: Mon, 8 Feb 2010 22:05:38 +0000 (+0000) Subject: use a c-style cast instead of reinterpret-cast, as sometimes the X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=3a3134ab12f3aa65f9791f702a73f6d0b2af423f;p=oota-llvm.git 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 --- diff --git a/include/llvm/Support/Casting.h b/include/llvm/Support/Casting.h index 37a7c3b02d4..17bcb599059 100644 --- a/include/llvm/Support/Casting.h +++ b/include/llvm/Support/Casting.h @@ -180,8 +180,9 @@ template struct cast_convert_val { template struct cast_convert_val { // This _is_ a simple type, just cast it. static typename cast_retty::ret_type doit(const FromTy &Val) { - return reinterpret_cast::ret_type>( - const_cast(Val)); + typename cast_retty::ret_type Res2 + = (typename cast_retty::ret_type)const_cast(Val); + return Res2; } };