From b38ba6b636c2295bbcf3c8e13fad40f6f5ec5698 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Tue, 1 Oct 2019 07:27:20 -0700 Subject: [PATCH] Revert static_cast in MkCastTo.py --- Runtime/MkCastTo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Runtime/MkCastTo.py b/Runtime/MkCastTo.py index 05cd3ce00..9c7d7e45e 100644 --- a/Runtime/MkCastTo.py +++ b/Runtime/MkCastTo.py @@ -184,7 +184,7 @@ for tp in CENTITY_TYPES: sourcef.write('''template void TCastToPtr::Visit(%s* p) { static_assert(sizeof(T) > 0 && !std::is_void_v, "TCastToPtr can not cast to incomplete type"); - ptr = static_cast(std::is_convertible_v<%s*, T*> ? p : nullptr); + ptr = reinterpret_cast(std::is_convertible_v<%s*, T*> ? p : nullptr); } ''' % (qual, qual))