From 3d6e53107b0d8942c7ad4e74f05bcdb3d951e480 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sun, 27 Sep 2026 08:46:59 -0700 Subject: [PATCH] Fixed MSVC unreachable warning. (#431) --- include/bx/inline/bx.inl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/bx/inline/bx.inl b/include/bx/inline/bx.inl index 8a4907f..759a9f2 100644 --- a/include/bx/inline/bx.inl +++ b/include/bx/inline/bx.inl @@ -298,6 +298,8 @@ namespace bx return static_cast(_from); } +BX_PRAGMA_DIAGNOSTIC_PUSH() +BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4702) // warning C4702: unreachable code template inline constexpr bool narrowCastTest(Ty* _out, const FromT& _from) { @@ -307,12 +309,10 @@ namespace bx return true; } -BX_PRAGMA_DIAGNOSTIC_PUSH() -BX_PRAGMA_DIAGNOSTIC_IGNORED_MSVC(4702) // warning C4702: unreachable code *_out = static_cast(_from); return static_cast(*_out) == _from; -BX_PRAGMA_DIAGNOSTIC_POP() } +BX_PRAGMA_DIAGNOSTIC_POP() template inline Ty narrowCast(const FromT& _from, Location _location)