test: special member functions warnings (linter)

This commit is contained in:
Michele Caini
2023-12-22 14:29:33 +01:00
parent 27698a2a0a
commit fc3df2b0ac
4 changed files with 23 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -66,6 +66,9 @@ struct destruction_order {
*ctx_check = (registry->ctx().find<ctx_check_type>() != nullptr);
}
destruction_order(const destruction_order &) = default;
destruction_order &operator=(const destruction_order &) = default;
~destruction_order() {
*ctx_check = *ctx_check && (registry->ctx().find<ctx_check_type>() != nullptr);
}

View File

@@ -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)} {}

View File

@@ -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;