diff --git a/src/entt/core/any.hpp b/src/entt/core/any.hpp index 27d5d86c0..4283a6b08 100644 --- a/src/entt/core/any.hpp +++ b/src/entt/core/any.hpp @@ -97,14 +97,15 @@ class basic_any { case request::move: ENTT_ASSERT(value.mode == any_policy::embedded, "Unexpected policy"); if constexpr(in_situ) { - // NOLINTNEXTLINE(bugprone-casting-through-void) - return static_cast(::new(&static_cast(const_cast(other))->storage) Type{std::move(*const_cast(elem))}); + // NOLINTNEXTLINE(bugprone-casting-through-void,bugprone-multi-level-implicit-pointer-conversion) + return ::new(&static_cast(const_cast(other))->storage) Type{std::move(*const_cast(elem))}; } [[fallthrough]]; case request::get: ENTT_ASSERT(value.mode == any_policy::embedded, "Unexpected policy"); if constexpr(in_situ) { - return static_cast(elem); + // NOLINTNEXTLINE(bugprone-multi-level-implicit-pointer-conversion) + return elem; } } @@ -122,6 +123,7 @@ class basic_any { if constexpr(std::is_lvalue_reference_v) { static_assert((std::is_lvalue_reference_v && ...) && (sizeof...(Args) == 1u), "Invalid arguments"); mode = std::is_const_v> ? any_policy::cref : any_policy::ref; + // NOLINTNEXTLINE(bugprone-multi-level-implicit-pointer-conversion) instance = (std::addressof(args), ...); } else if constexpr(in_situ) { mode = any_policy::embedded;