From 21ef6d930ad3eb2fb435cd601692cb5cc1726bd8 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Fri, 5 Apr 2024 15:15:13 +0200 Subject: [PATCH] QSystemLocale(): disable copy and move Axivion (SV546) points out (based on a clazy "rule of three" that might be rule of five by now) the lack of move and copy assignment and construction. We don't want those anyway, so tell the compiler not to create them. Pick-to: 6.7 6.5 Task-number: QTBUG-122619 Change-Id: Ie951a2c3d60d76ad3448310d3f9bbda22190015b Reviewed-by: Giuseppe D'Angelo Reviewed-by: Thiago Macieira --- src/corelib/text/qlocale_p.h | 1 + src/plugins/platforms/android/qandroidsystemlocale.h | 1 + tests/auto/corelib/text/qlocale/tst_qlocale.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/src/corelib/text/qlocale_p.h b/src/corelib/text/qlocale_p.h index fb312c5dfb9..905b45e5e9c 100644 --- a/src/corelib/text/qlocale_p.h +++ b/src/corelib/text/qlocale_p.h @@ -105,6 +105,7 @@ struct QLocaleData; // Subclassed by Android platform plugin: class Q_CORE_EXPORT QSystemLocale { + Q_DISABLE_COPY_MOVE(QSystemLocale) QSystemLocale *next = nullptr; // Maintains a stack. public: diff --git a/src/plugins/platforms/android/qandroidsystemlocale.h b/src/plugins/platforms/android/qandroidsystemlocale.h index 48e1d94a569..b4a4070bd59 100644 --- a/src/plugins/platforms/android/qandroidsystemlocale.h +++ b/src/plugins/platforms/android/qandroidsystemlocale.h @@ -11,6 +11,7 @@ QT_BEGIN_NAMESPACE class QAndroidSystemLocale : public QSystemLocale { + Q_DISABLE_COPY_MOVE(QAndroidSystemLocale) public: QAndroidSystemLocale(); diff --git a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp index 8cc7f9af6ec..de07684f843 100644 --- a/tests/auto/corelib/text/qlocale/tst_qlocale.cpp +++ b/tests/auto/corelib/text/qlocale/tst_qlocale.cpp @@ -4012,6 +4012,7 @@ void tst_QLocale::bcp47Name() # ifdef QT_BUILD_INTERNAL class MySystemLocale : public QSystemLocale { + Q_DISABLE_COPY_MOVE(MySystemLocale) public: MySystemLocale(const QString &locale) : m_name(locale), m_id(QLocaleId::fromName(locale)), m_locale(locale)