Просмотр исходного кода

test: special member functions warnings (linter)

Michele Caini 2 лет назад
Родитель
Сommit
fc3df2b0ac

+ 6 - 0
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;
     }

+ 3 - 0
test/entt/entity/registry.cpp

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

+ 3 - 0
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)} {}

+ 11 - 0
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;