diff options
Diffstat (limited to 'include/llvm/ADT/PointerUnion.h')
-rw-r--r-- | include/llvm/ADT/PointerUnion.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/llvm/ADT/PointerUnion.h b/include/llvm/ADT/PointerUnion.h index 7ce70ebc8ce0..aeab641f5715 100644 --- a/include/llvm/ADT/PointerUnion.h +++ b/include/llvm/ADT/PointerUnion.h @@ -158,7 +158,7 @@ public: assert( get<PT1>() == Val.getPointer() && "Can't get the address because PointerLikeTypeTraits changes the ptr"); - return (PT1 *)Val.getAddrOfPointer(); + return const_cast<PT1 *>(reinterpret_cast<const PT1 *>(Val.getAddrOfPointer())); } /// Assignment from nullptr which just clears the union. |