From bf5d5bfc0ce8a1cfddaf954eb0c5225be4f429a5 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Mon, 20 Sep 2021 13:17:10 +0200 Subject: [PATCH] QScoped(Array)Pointer: use the rule of 5 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CodeChecker complains regarding the two classes not having all the special 5 declared, so do it. Change-Id: I76d562c52f89a24aec9f155c2be62f8844f1f4a7 Reviewed-by: Edward Welbourne Reviewed-by: Ievgenii Meshcheriakov Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Qt CI Bot Reviewed-by: Volker Hilsheimer --- src/corelib/tools/qscopedpointer.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/corelib/tools/qscopedpointer.h b/src/corelib/tools/qscopedpointer.h index 43e0718699..c9afb248a1 100644 --- a/src/corelib/tools/qscopedpointer.h +++ b/src/corelib/tools/qscopedpointer.h @@ -219,7 +219,7 @@ protected: T *d; private: - Q_DISABLE_COPY(QScopedPointer) + Q_DISABLE_COPY_MOVE(QScopedPointer) }; template > @@ -229,6 +229,7 @@ class [[nodiscard]] QScopedArrayPointer : public QScopedPointer using if_same_type = typename std::enable_if::type, Ptr>::value, bool>::type; public: inline QScopedArrayPointer() : QScopedPointer(nullptr) {} + inline ~QScopedArrayPointer() = default; template = true> explicit QScopedArrayPointer(D *p) @@ -265,7 +266,7 @@ private: // allowed and results in undefined behavior. } - Q_DISABLE_COPY(QScopedArrayPointer) + Q_DISABLE_COPY_MOVE(QScopedArrayPointer) }; #if QT_DEPRECATED_SINCE(6, 2)