Index: llvm/trunk/include/llvm/ADT/PointerUnion.h =================================================================== --- llvm/trunk/include/llvm/ADT/PointerUnion.h +++ llvm/trunk/include/llvm/ADT/PointerUnion.h @@ -158,7 +158,7 @@ assert( get() == Val.getPointer() && "Can't get the address because PointerLikeTypeTraits changes the ptr"); - return (PT1 *)Val.getAddrOfPointer(); + return const_cast(reinterpret_cast(Val.getAddrOfPointer())); } /// Assignment from nullptr which just clears the union.