From f6e99f347d243749af8d9beacd7c68852f0ff636 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Wed, 8 Jan 2025 16:36:08 +0100 Subject: [PATCH] QListSpecialMethods: honor RO5 This looks like another case of a base class with a protected, defaulted destructor, which interferes with RO5. Explicitly redeclare the other special member functions in order to suppress the warnings coming from the deprecated copies. Pick-to: 6.9 6.8 Change-Id: Icf8c8817ef001d0503683d071c4f004db64caa2d Reviewed-by: Marc Mutz --- src/corelib/text/qbytearraylist.h | 5 +++++ src/corelib/tools/qlist.h | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/src/corelib/text/qbytearraylist.h b/src/corelib/text/qbytearraylist.h index f5302884f1b..cfae7f5bdff 100644 --- a/src/corelib/text/qbytearraylist.h +++ b/src/corelib/text/qbytearraylist.h @@ -37,7 +37,12 @@ template <> struct QListSpecialMethods : QListSpecialMethodsBase::indexOf; diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h index b9ff33aca62..81139c5891b 100644 --- a/src/corelib/tools/qlist.h +++ b/src/corelib/tools/qlist.h @@ -31,7 +31,12 @@ namespace QtPrivate { template struct QListSpecialMethodsBase { protected: + QListSpecialMethodsBase() = default; ~QListSpecialMethodsBase() = default; + QListSpecialMethodsBase(const QListSpecialMethodsBase &) = default; + QListSpecialMethodsBase(QListSpecialMethodsBase &&) = default; + QListSpecialMethodsBase &operator=(const QListSpecialMethodsBase &) = default; + QListSpecialMethodsBase &operator=(QListSpecialMethodsBase &&) = default; using Self = QList; Self *self() { return static_cast(this); } @@ -52,7 +57,13 @@ public: template struct QListSpecialMethods : QListSpecialMethodsBase { protected: + QListSpecialMethods() = default; ~QListSpecialMethods() = default; + QListSpecialMethods(const QListSpecialMethods &) = default; + QListSpecialMethods(QListSpecialMethods &&) = default; + QListSpecialMethods &operator=(const QListSpecialMethods &) = default; + QListSpecialMethods &operator=(QListSpecialMethods &&) = default; + public: using QListSpecialMethodsBase::indexOf; using QListSpecialMethodsBase::lastIndexOf;