diff --git a/src/rttr/detail/conversion/number_conversion.h b/src/rttr/detail/conversion/number_conversion.h index ac40c63b..24de7950 100644 --- a/src/rttr/detail/conversion/number_conversion.h +++ b/src/rttr/detail/conversion/number_conversion.h @@ -134,9 +134,9 @@ typename std::enable_if::value && bool>::type convert_to(const F& from, T& to) { - if (from > std::numeric_limits::max()) + if (from > static_cast(std::numeric_limits::max())) return false; // value too large - else if (from < -std::numeric_limits::max()) + else if (from < static_cast(-std::numeric_limits::max())) return false; // value to small to = static_cast(from); @@ -151,7 +151,7 @@ typename std::enable_if::value && bool>::type convert_to(const F& from, T& to) { - if (from < 0 || from > std::numeric_limits::max()) + if (from < 0 || from > static_cast(std::numeric_limits::max())) return false; // value too large to = static_cast(from); diff --git a/src/unit_tests/variant/variant_assign_test.cpp b/src/unit_tests/variant/variant_assign_test.cpp index 4f6509d7..f73df284 100644 --- a/src/unit_tests/variant/variant_assign_test.cpp +++ b/src/unit_tests/variant/variant_assign_test.cpp @@ -150,6 +150,11 @@ TEST_CASE("move assignment", "[variant]") TEST_CASE("variant::operator=() - self assignment", "[variant]") { +#if RTTR_COMPILER == RTTR_COMPILER_CLANG || RTTR_COMPILER == RTTR_COMPILER_APPLECLANG + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wself-assign" +#endif + SECTION("self assign - empty") { variant a; @@ -165,6 +170,10 @@ TEST_CASE("variant::operator=() - self assignment", "[variant]") CHECK(a.is_valid() == true); } + +#if RTTR_COMPILER == RTTR_COMPILER_CLANG || RTTR_COMPILER == RTTR_COMPILER_APPLECLANG + #pragma clang diagnostic pop +#endif } /////////////////////////////////////////////////////////////////////////////////////////