From f78c3e41be6e01aad47fc47163c1ad2caff101c0 Mon Sep 17 00:00:00 2001 From: peterbell10 Date: Sat, 20 Jan 2018 20:15:30 +0000 Subject: [PATCH] Fix unreachable code warning when signbit returns bool --- fmt/format.h | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/fmt/format.h b/fmt/format.h index c6ee44d1..23276591 100644 --- a/fmt/format.h +++ b/fmt/format.h @@ -456,8 +456,7 @@ class numeric_limits : using namespace fmt::internal; // The resolution "priority" is: // isinf macro > std::isinf > ::isinf > fmt::internal::isinf - if (const_check(sizeof(isinf(x)) == sizeof(bool) || - sizeof(isinf(x)) == sizeof(int))) { + if (const_check(sizeof(isinf(x)) != sizeof(fmt::internal::DummyInt))) { return isinf(x) != 0; } return !_finite(static_cast(x)); @@ -467,8 +466,7 @@ class numeric_limits : template static bool isnotanumber(T x) { using namespace fmt::internal; - if (const_check(sizeof(isnan(x)) == sizeof(bool) || - sizeof(isnan(x)) == sizeof(int))) { + if (const_check(sizeof(isnan(x)) != sizeof(fmt::internal::DummyInt))) { return isnan(x) != 0; } return _isnan(static_cast(x)) != 0; @@ -477,8 +475,7 @@ class numeric_limits : // Portable version of signbit. static bool isnegative(double x) { using namespace fmt::internal; - if (const_check(sizeof(signbit(x)) == sizeof(bool) || - sizeof(signbit(x)) == sizeof(int))) { + if (const_check(sizeof(signbit(x)) != sizeof(fmt::internal::DummyInt))) { return signbit(x) != 0; } if (x < 0) return true;