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.

Change-Id: Icf8c8817ef001d0503683d071c4f004db64caa2d
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
(cherry picked from commit f6e99f347d243749af8d9beacd7c68852f0ff636)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 25296f86d6b1394035384c5aced0dbfaf0bdfd86)
This commit is contained in:
Giuseppe D'Angelo 2025-01-08 16:36:08 +01:00 committed by Qt Cherry-pick Bot
parent 8ba1f4ab8a
commit 516ace2e6a
2 changed files with 16 additions and 0 deletions

View File

@ -37,7 +37,12 @@ template <> struct QListSpecialMethods<QByteArray> : QListSpecialMethodsBase<QBy
{
#ifndef Q_QDOC
protected:
QListSpecialMethods() = default;
~QListSpecialMethods() = default;
QListSpecialMethods(const QListSpecialMethods &) = default;
QListSpecialMethods(QListSpecialMethods &&) = default;
QListSpecialMethods &operator=(const QListSpecialMethods &) = default;
QListSpecialMethods &operator=(QListSpecialMethods &&) = default;
#endif
public:
using QListSpecialMethodsBase<QByteArray>::indexOf;

View File

@ -30,7 +30,12 @@ namespace QtPrivate {
template <typename T> 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<T>;
Self *self() { return static_cast<Self *>(this); }
@ -51,7 +56,13 @@ public:
template <typename T> struct QListSpecialMethods : QListSpecialMethodsBase<T>
{
protected:
QListSpecialMethods() = default;
~QListSpecialMethods() = default;
QListSpecialMethods(const QListSpecialMethods &) = default;
QListSpecialMethods(QListSpecialMethods &&) = default;
QListSpecialMethods &operator=(const QListSpecialMethods &) = default;
QListSpecialMethods &operator=(QListSpecialMethods &&) = default;
public:
using QListSpecialMethodsBase<T>::indexOf;
using QListSpecialMethodsBase<T>::lastIndexOf;