summaryrefslogtreecommitdiffstats
path: root/recipes-qt/qt5/qtbase/0017-Fix-Wdeprecated-copy-warnings.patch
diff options
context:
space:
mode:
Diffstat (limited to 'recipes-qt/qt5/qtbase/0017-Fix-Wdeprecated-copy-warnings.patch')
-rw-r--r--recipes-qt/qt5/qtbase/0017-Fix-Wdeprecated-copy-warnings.patch371
1 files changed, 371 insertions, 0 deletions
diff --git a/recipes-qt/qt5/qtbase/0017-Fix-Wdeprecated-copy-warnings.patch b/recipes-qt/qt5/qtbase/0017-Fix-Wdeprecated-copy-warnings.patch
new file mode 100644
index 00000000..a5c4bd32
--- /dev/null
+++ b/recipes-qt/qt5/qtbase/0017-Fix-Wdeprecated-copy-warnings.patch
@@ -0,0 +1,371 @@
1From 3b92a70c05eebc645d83c5570dac0285f612c039 Mon Sep 17 00:00:00 2001
2From: Allan Sandfeld Jensen <allan.jensen@qt.io>
3Date: Tue, 13 Nov 2018 17:14:43 +0100
4Subject: [PATCH] Fix -Wdeprecated-copy warnings
5
6Implicit copy constructors or methods are considered deprecated for
7classes that has one of the two or a destructor.
8
9The warning is enabled with -Wextra in gcc 9
10
11Change-Id: Ic9be654f2a142fb186a4d5a7d6b4f7d6f4e611d8
12Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
13
14Upstream-Status: Backport from 5.13
15
16Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
17---
18 mkspecs/features/qt_common.prf | 19 ++++++-------------
19 src/corelib/io/qprocess_p.h | 3 +--
20 src/corelib/kernel/qvariant.h | 5 ++++-
21 src/corelib/tools/qbytearraylist.h | 2 +-
22 src/corelib/tools/qlist.h | 6 +++++-
23 src/corelib/tools/qstringlist.h | 2 +-
24 src/gui/painting/qtriangulator_p.h | 2 ++
25 src/gui/text/qtextobject.h | 1 +
26 src/widgets/styles/qstyleoption.h | 23 +++++++++++++++++++++++
27 9 files changed, 44 insertions(+), 19 deletions(-)
28
29diff --git a/mkspecs/features/qt_common.prf b/mkspecs/features/qt_common.prf
30index 6cb2e78c1c..1cf2d45168 100644
31--- a/mkspecs/features/qt_common.prf
32+++ b/mkspecs/features/qt_common.prf
33@@ -89,14 +89,8 @@ clang {
34 greaterThan(QT_GCC_MAJOR_VERSION, 5): QMAKE_CXXFLAGS_WARN_ON += -Wshift-overflow=2 -Wduplicated-cond
35 # GCC 7 has a lot of false positives relating to this, so disable completely
36 greaterThan(QT_GCC_MAJOR_VERSION, 6): QMAKE_CXXFLAGS_WARN_ON += -Wno-stringop-overflow
37- # GCC 9 has a lot of false positives relating to this, so disable completely
38- greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-deprecated-copy
39- # GCC 9 introduced this
40- greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-redundant-move
41- # GCC 9 introduced this
42+ # GCC 9 introduced -Wformat-overflow in -Wall, but it is buggy:
43 greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-format-overflow
44- # GCC 9 introduced this
45- greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-init-list-lifetime
46 }
47
48 warnings_are_errors:warning_clean {
49@@ -136,14 +130,13 @@ warnings_are_errors:warning_clean {
50
51 # GCC 7 includes -Wimplicit-fallthrough in -Wextra, but Qt is not yet free of implicit fallthroughs.
52 greaterThan(QT_GCC_MAJOR_VERSION, 6): QMAKE_CXXFLAGS_WARN_ON += -Wno-error=implicit-fallthrough
53- # GCC 9 has a lot of false positives relating to this, so disable completely
54- greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-deprecated-copy
55+ # GCC 9 introduced -Wdeprecated-copy in -Wextra, but we are not clean for it.
56+ greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-error=deprecated-copy
57 # GCC 9 introduced this
58- greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-redundant-move
59+ greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-error=redundant-move
60 # GCC 9 introduced this
61- greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-format-overflow
62- # GCC 9 introduced this
63- greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-init-list-lifetime
64+ greaterThan(QT_GCC_MAJOR_VERSION, 8): QMAKE_CXXFLAGS_WARN_ON += -Wno-error=init-list-lifetime
65+
66 # Work-around for bug https://code.google.com/p/android/issues/detail?id=58135
67 android: QMAKE_CXXFLAGS_WARN_ON += -Wno-error=literal-suffix
68 }
69diff --git a/src/corelib/io/qprocess_p.h b/src/corelib/io/qprocess_p.h
70index aa7ecbe91d..eb2d1ed048 100644
71--- a/src/corelib/io/qprocess_p.h
72+++ b/src/corelib/io/qprocess_p.h
73@@ -108,8 +108,7 @@ using QProcEnvKey = QByteArray;
74 class QProcEnvValue
75 {
76 public:
77- QProcEnvValue() {}
78- QProcEnvValue(const QProcEnvValue &other) { *this = other; }
79+ QProcEnvValue() = default;
80 explicit QProcEnvValue(const QString &value) : stringValue(value) {}
81 explicit QProcEnvValue(const QByteArray &value) : byteValue(value) {}
82 bool operator==(const QProcEnvValue &other) const
83diff --git a/src/corelib/kernel/qvariant.h b/src/corelib/kernel/qvariant.h
84index ff73c27b6e..2394dc58f8 100644
85--- a/src/corelib/kernel/qvariant.h
86+++ b/src/corelib/kernel/qvariant.h
87@@ -396,10 +396,13 @@ class Q_CORE_EXPORT QVariant
88 : type(variantType), is_shared(false), is_null(false)
89 {}
90
91- inline Private(const Private &other) Q_DECL_NOTHROW
92+#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
93+ Private(const Private &other) Q_DECL_NOTHROW
94 : data(other.data), type(other.type),
95 is_shared(other.is_shared), is_null(other.is_null)
96 {}
97+ Private &operator=(const Private &other) Q_DECL_NOTHROW = default;
98+#endif
99 union Data
100 {
101 char c;
102diff --git a/src/corelib/tools/qbytearraylist.h b/src/corelib/tools/qbytearraylist.h
103index ed014dd157..3b5266492f 100644
104--- a/src/corelib/tools/qbytearraylist.h
105+++ b/src/corelib/tools/qbytearraylist.h
106@@ -66,7 +66,7 @@ template <> struct QListSpecialMethods<QByteArray>
107 {
108 #ifndef Q_QDOC
109 protected:
110- ~QListSpecialMethods() {}
111+ ~QListSpecialMethods() = default;
112 #endif
113 public:
114 inline QByteArray join() const
115diff --git a/src/corelib/tools/qlist.h b/src/corelib/tools/qlist.h
116index 49ccbc9c9f..1e77b08a15 100644
117--- a/src/corelib/tools/qlist.h
118+++ b/src/corelib/tools/qlist.h
119@@ -72,7 +72,7 @@ template <typename T> class QSet;
120 template <typename T> struct QListSpecialMethods
121 {
122 protected:
123- ~QListSpecialMethods() {}
124+ ~QListSpecialMethods() = default;
125 };
126 template <> struct QListSpecialMethods<QByteArray>;
127 template <> struct QListSpecialMethods<QString>;
128@@ -237,6 +237,8 @@ public:
129 // can't remove it in Qt 5, since doing so would make the type trivial,
130 // which changes the way it's passed to functions by value.
131 inline iterator(const iterator &o) Q_DECL_NOTHROW : i(o.i){}
132+ inline iterator &operator=(const iterator &o) Q_DECL_NOTHROW
133+ { i = o.i; return *this; }
134 #endif
135 inline T &operator*() const { return i->t(); }
136 inline T *operator->() const { return &i->t(); }
137@@ -290,6 +292,8 @@ public:
138 // can't remove it in Qt 5, since doing so would make the type trivial,
139 // which changes the way it's passed to functions by value.
140 inline const_iterator(const const_iterator &o) Q_DECL_NOTHROW : i(o.i) {}
141+ inline const_iterator &operator=(const const_iterator &o) Q_DECL_NOTHROW
142+ { i = o.i; return *this; }
143 #endif
144 #ifdef QT_STRICT_ITERATORS
145 inline explicit const_iterator(const iterator &o) Q_DECL_NOTHROW : i(o.i) {}
146diff --git a/src/corelib/tools/qstringlist.h b/src/corelib/tools/qstringlist.h
147index 10cbad04d6..693cfe30c4 100644
148--- a/src/corelib/tools/qstringlist.h
149+++ b/src/corelib/tools/qstringlist.h
150@@ -66,7 +66,7 @@ template <> struct QListSpecialMethods<QString>
151 {
152 #ifndef Q_QDOC
153 protected:
154- ~QListSpecialMethods() {}
155+ ~QListSpecialMethods() = default;
156 #endif
157 public:
158 inline void sort(Qt::CaseSensitivity cs = Qt::CaseSensitive);
159diff --git a/src/gui/painting/qtriangulator_p.h b/src/gui/painting/qtriangulator_p.h
160index 8f043fc925..c9ae2571f4 100644
161--- a/src/gui/painting/qtriangulator_p.h
162+++ b/src/gui/painting/qtriangulator_p.h
163@@ -93,6 +93,8 @@ public:
164 return indices16.size();
165 }
166
167+ QVertexIndexVector() = default;
168+ QVertexIndexVector(const QVertexIndexVector &other) = default;
169 inline QVertexIndexVector &operator = (const QVertexIndexVector &other)
170 {
171 if (t == UnsignedInt)
172diff --git a/src/gui/text/qtextobject.h b/src/gui/text/qtextobject.h
173index 067f8473ea..694eb729d5 100644
174--- a/src/gui/text/qtextobject.h
175+++ b/src/gui/text/qtextobject.h
176@@ -263,6 +263,7 @@ public:
177 iterator() : p(nullptr), b(0), e(0), n(0) {}
178 #if QT_VERSION < QT_VERSION_CHECK(6,0,0)
179 iterator(const iterator &o) : p(o.p), b(o.b), e(o.e), n(o.n) {}
180+ iterator &operator=(const iterator &o) = default;
181 #endif
182
183 QTextFragment fragment() const;
184diff --git a/src/widgets/styles/qstyleoption.h b/src/widgets/styles/qstyleoption.h
185index 8ae07efc81..763575ff5b 100644
186--- a/src/widgets/styles/qstyleoption.h
187+++ b/src/widgets/styles/qstyleoption.h
188@@ -118,6 +118,7 @@ public:
189
190 QStyleOptionFocusRect();
191 QStyleOptionFocusRect(const QStyleOptionFocusRect &other) : QStyleOption(Version, Type) { *this = other; }
192+ QStyleOptionFocusRect &operator=(const QStyleOptionFocusRect &other) = default;
193
194 protected:
195 QStyleOptionFocusRect(int version);
196@@ -142,6 +143,7 @@ public:
197
198 QStyleOptionFrame();
199 QStyleOptionFrame(const QStyleOptionFrame &other) : QStyleOption(Version, Type) { *this = other; }
200+ QStyleOptionFrame &operator=(const QStyleOptionFrame &other) = default;
201
202 protected:
203 QStyleOptionFrame(int version);
204@@ -171,6 +173,7 @@ public:
205 QStyleOptionTabWidgetFrame();
206 inline QStyleOptionTabWidgetFrame(const QStyleOptionTabWidgetFrame &other)
207 : QStyleOption(Version, Type) { *this = other; }
208+ QStyleOptionTabWidgetFrame &operator=(const QStyleOptionTabWidgetFrame &other) = default;
209
210 protected:
211 QStyleOptionTabWidgetFrame(int version);
212@@ -194,6 +197,7 @@ public:
213
214 QStyleOptionTabBarBase();
215 QStyleOptionTabBarBase(const QStyleOptionTabBarBase &other) : QStyleOption(Version, Type) { *this = other; }
216+ QStyleOptionTabBarBase &operator=(const QStyleOptionTabBarBase &other) = default;
217
218 protected:
219 QStyleOptionTabBarBase(int version);
220@@ -225,6 +229,7 @@ public:
221
222 QStyleOptionHeader();
223 QStyleOptionHeader(const QStyleOptionHeader &other) : QStyleOption(Version, Type) { *this = other; }
224+ QStyleOptionHeader &operator=(const QStyleOptionHeader &other) = default;
225
226 protected:
227 QStyleOptionHeader(int version);
228@@ -247,6 +252,7 @@ public:
229
230 QStyleOptionButton();
231 QStyleOptionButton(const QStyleOptionButton &other) : QStyleOption(Version, Type) { *this = other; }
232+ QStyleOptionButton &operator=(const QStyleOptionButton &other) = default;
233
234 protected:
235 QStyleOptionButton(int version);
236@@ -284,6 +290,7 @@ public:
237
238 QStyleOptionTab();
239 QStyleOptionTab(const QStyleOptionTab &other) : QStyleOption(Version, Type) { *this = other; }
240+ QStyleOptionTab &operator=(const QStyleOptionTab &other) = default;
241
242 protected:
243 QStyleOptionTab(int version);
244@@ -314,6 +321,7 @@ public:
245 int midLineWidth;
246 QStyleOptionToolBar();
247 QStyleOptionToolBar(const QStyleOptionToolBar &other) : QStyleOption(Version, Type) { *this = other; }
248+ QStyleOptionToolBar &operator=(const QStyleOptionToolBar &other) = default;
249
250 protected:
251 QStyleOptionToolBar(int version);
252@@ -341,6 +349,7 @@ public:
253
254 QStyleOptionProgressBar();
255 QStyleOptionProgressBar(const QStyleOptionProgressBar &other) : QStyleOption(Version, Type) { *this = other; }
256+ QStyleOptionProgressBar &operator=(const QStyleOptionProgressBar &other) = default;
257
258 protected:
259 QStyleOptionProgressBar(int version);
260@@ -371,6 +380,7 @@ public:
261
262 QStyleOptionMenuItem();
263 QStyleOptionMenuItem(const QStyleOptionMenuItem &other) : QStyleOption(Version, Type) { *this = other; }
264+ QStyleOptionMenuItem &operator=(const QStyleOptionMenuItem &other) = default;
265
266 protected:
267 QStyleOptionMenuItem(int version);
268@@ -390,6 +400,7 @@ public:
269
270 QStyleOptionDockWidget();
271 QStyleOptionDockWidget(const QStyleOptionDockWidget &other) : QStyleOption(Version, Type) { *this = other; }
272+ QStyleOptionDockWidget &operator=(const QStyleOptionDockWidget &other) = default;
273
274 protected:
275 QStyleOptionDockWidget(int version);
276@@ -441,6 +452,7 @@ public:
277
278 QStyleOptionViewItem();
279 QStyleOptionViewItem(const QStyleOptionViewItem &other) : QStyleOption(Version, Type) { *this = other; }
280+ QStyleOptionViewItem &operator=(const QStyleOptionViewItem &other) = default;
281
282 protected:
283 QStyleOptionViewItem(int version);
284@@ -471,6 +483,7 @@ public:
285
286 QStyleOptionToolBox();
287 QStyleOptionToolBox(const QStyleOptionToolBox &other) : QStyleOption(Version, Type) { *this = other; }
288+ QStyleOptionToolBox &operator=(const QStyleOptionToolBox &other) = default;
289
290 protected:
291 QStyleOptionToolBox(int version);
292@@ -490,6 +503,7 @@ public:
293
294 QStyleOptionRubberBand();
295 QStyleOptionRubberBand(const QStyleOptionRubberBand &other) : QStyleOption(Version, Type) { *this = other; }
296+ QStyleOptionRubberBand &operator=(const QStyleOptionRubberBand &other) = default;
297
298 protected:
299 QStyleOptionRubberBand(int version);
300@@ -508,6 +522,7 @@ public:
301
302 QStyleOptionComplex(int version = QStyleOptionComplex::Version, int type = SO_Complex);
303 QStyleOptionComplex(const QStyleOptionComplex &other) : QStyleOption(Version, Type) { *this = other; }
304+ QStyleOptionComplex &operator=(const QStyleOptionComplex &other) = default;
305 };
306
307 #if QT_CONFIG(slider)
308@@ -532,6 +547,7 @@ public:
309
310 QStyleOptionSlider();
311 QStyleOptionSlider(const QStyleOptionSlider &other) : QStyleOptionComplex(Version, Type) { *this = other; }
312+ QStyleOptionSlider &operator=(const QStyleOptionSlider &other) = default;
313
314 protected:
315 QStyleOptionSlider(int version);
316@@ -551,6 +567,7 @@ public:
317
318 QStyleOptionSpinBox();
319 QStyleOptionSpinBox(const QStyleOptionSpinBox &other) : QStyleOptionComplex(Version, Type) { *this = other; }
320+ QStyleOptionSpinBox &operator=(const QStyleOptionSpinBox &other) = default;
321
322 protected:
323 QStyleOptionSpinBox(int version);
324@@ -578,6 +595,7 @@ public:
325
326 QStyleOptionToolButton();
327 QStyleOptionToolButton(const QStyleOptionToolButton &other) : QStyleOptionComplex(Version, Type) { *this = other; }
328+ QStyleOptionToolButton &operator=(const QStyleOptionToolButton &other) = default;
329
330 protected:
331 QStyleOptionToolButton(int version);
332@@ -600,6 +618,7 @@ public:
333
334 QStyleOptionComboBox();
335 QStyleOptionComboBox(const QStyleOptionComboBox &other) : QStyleOptionComplex(Version, Type) { *this = other; }
336+ QStyleOptionComboBox &operator=(const QStyleOptionComboBox &other) = default;
337
338 protected:
339 QStyleOptionComboBox(int version);
340@@ -618,6 +637,7 @@ public:
341
342 QStyleOptionTitleBar();
343 QStyleOptionTitleBar(const QStyleOptionTitleBar &other) : QStyleOptionComplex(Version, Type) { *this = other; }
344+ QStyleOptionTitleBar &operator=(const QStyleOptionTitleBar &other) = default;
345
346 protected:
347 QStyleOptionTitleBar(int version);
348@@ -638,6 +658,7 @@ public:
349
350 QStyleOptionGroupBox();
351 QStyleOptionGroupBox(const QStyleOptionGroupBox &other) : QStyleOptionComplex(Version, Type) { *this = other; }
352+ QStyleOptionGroupBox &operator=(const QStyleOptionGroupBox &other) = default;
353 protected:
354 QStyleOptionGroupBox(int version);
355 };
356@@ -652,6 +673,7 @@ public:
357
358 QStyleOptionSizeGrip();
359 QStyleOptionSizeGrip(const QStyleOptionSizeGrip &other) : QStyleOptionComplex(Version, Type) { *this = other; }
360+ QStyleOptionSizeGrip &operator=(const QStyleOptionSizeGrip &other) = default;
361 protected:
362 QStyleOptionSizeGrip(int version);
363 };
364@@ -668,6 +690,7 @@ public:
365
366 QStyleOptionGraphicsItem();
367 QStyleOptionGraphicsItem(const QStyleOptionGraphicsItem &other) : QStyleOption(Version, Type) { *this = other; }
368+ QStyleOptionGraphicsItem &operator=(const QStyleOptionGraphicsItem &other) = default;
369 static qreal levelOfDetailFromTransform(const QTransform &worldTransform);
370 protected:
371 QStyleOptionGraphicsItem(int version);