From fc3df2b0acdb888d87e2d62222811ecf505cebc8 Mon Sep 17 00:00:00 2001 From: Michele Caini Date: Fri, 22 Dec 2023 14:29:33 +0100 Subject: [PATCH] test: special member functions warnings (linter) --- test/entt/core/any.cpp | 6 ++++++ test/entt/entity/registry.cpp | 3 +++ test/entt/entity/storage.cpp | 3 +++ test/entt/meta/meta_any.cpp | 11 +++++++++++ 4 files changed, 23 insertions(+) diff --git a/test/entt/core/any.cpp b/test/entt/core/any.cpp index 57645afdd..bf6deeecb 100644 --- a/test/entt/core/any.cpp +++ b/test/entt/core/any.cpp @@ -16,6 +16,9 @@ #include "../common/non_movable.h" struct empty { + empty(const empty &) = default; + empty &operator=(const empty &) = default; + ~empty() { ++counter; } @@ -27,6 +30,9 @@ struct fat { fat(double v1, double v2, double v3, double v4) : value{v1, v2, v3, v4} {} + fat(const fat &) = default; + fat &operator=(const fat &) = default; + ~fat() { ++counter; } diff --git a/test/entt/entity/registry.cpp b/test/entt/entity/registry.cpp index e3453ca92..a0ae00ba6 100644 --- a/test/entt/entity/registry.cpp +++ b/test/entt/entity/registry.cpp @@ -66,6 +66,9 @@ struct destruction_order { *ctx_check = (registry->ctx().find() != nullptr); } + destruction_order(const destruction_order &) = default; + destruction_order &operator=(const destruction_order &) = default; + ~destruction_order() { *ctx_check = *ctx_check && (registry->ctx().find() != nullptr); } diff --git a/test/entt/entity/storage.cpp b/test/entt/entity/storage.cpp index 8f7736e16..7a5ce480d 100644 --- a/test/entt/entity/storage.cpp +++ b/test/entt/entity/storage.cpp @@ -24,6 +24,9 @@ struct update_from_destructor { : storage{&ref}, target{other} {} + update_from_destructor(const update_from_destructor &) = default; + update_from_destructor &operator=(const update_from_destructor &) = default; + update_from_destructor(update_from_destructor &&other) noexcept : storage{std::exchange(other.storage, nullptr)}, target{std::exchange(other.target, entt::null)} {} diff --git a/test/entt/meta/meta_any.cpp b/test/entt/meta/meta_any.cpp index 7e57e8b19..988584ad9 100644 --- a/test/entt/meta/meta_any.cpp +++ b/test/entt/meta/meta_any.cpp @@ -28,6 +28,11 @@ struct clazz_t { }; struct empty_t { + empty_t() = default; + + empty_t(const empty_t &) = default; + empty_t &operator=(const empty_t &) = default; + virtual ~empty_t() { ++destructor_counter; } @@ -47,6 +52,11 @@ struct fat_t: empty_t { fat_t(double v1, double v2, double v3, double v4) : value{v1, v2, v3, v4} {} + ~fat_t() override = default; + + fat_t(const fat_t &) = default; + fat_t &operator=(const fat_t &) = default; + bool operator==(const fat_t &other) const { return std::equal(std::begin(value), std::end(value), std::begin(other.value), std::end(other.value)); } @@ -61,6 +71,7 @@ enum class enum_class : unsigned short int { struct unmanageable_t { unmanageable_t() = default; + ~unmanageable_t() = default; unmanageable_t(const unmanageable_t &) = delete; unmanageable_t(unmanageable_t &&) = delete; unmanageable_t &operator=(const unmanageable_t &) = delete;