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; } };