summaryrefslogtreecommitdiffstats
path: root/src/gui/painting/qmatrix.h
diff options
context:
space:
mode:
authorVille Voutilainen <ville.voutilainen@qt.io>2018-01-12 16:29:00 +0200
committerVille Voutilainen <ville.voutilainen@qt.io>2018-01-25 18:20:20 +0000
commit342bb5b03a76d1428fafb8e1532d66e172bd1c0b (patch)
treee2aaeecbbbc95c8b10d2bcd15540c217669c7ac4 /src/gui/painting/qmatrix.h
parenta87b549edfb66b3c3bc14466455792aea6e80c84 (diff)
Do a static_cast in bit-blasts that are UB
Without this, building Qt and Qt applications fails with GCC 8. The errors look like this: writing to an object of type ‘class QPointer<QQuickPointerHandler>’ with no trivial copy-assignment; use copy-assignment or copy-initialization instead [-Werror=class-memaccess] Task-number: QTBUG-65691 Change-Id: Ie5a30814125deca7a160b9a61f5aa3f944ee1ac9 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/painting/qmatrix.h')
-rw-r--r--src/gui/painting/qmatrix.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/painting/qmatrix.h b/src/gui/painting/qmatrix.h
index 15e0ab5be1..dafb746bc6 100644
--- a/src/gui/painting/qmatrix.h
+++ b/src/gui/painting/qmatrix.h
@@ -65,10 +65,10 @@ public:
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// ### Qt 6: remove; the compiler-generated ones are fine!
QMatrix &operator=(QMatrix &&other) Q_DECL_NOTHROW // = default
- { memcpy(this, &other, sizeof(QMatrix)); return *this; }
+ { memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(QMatrix)); return *this; }
QMatrix &operator=(const QMatrix &) Q_DECL_NOTHROW; // = default
QMatrix(QMatrix &&other) Q_DECL_NOTHROW // = default
- { memcpy(this, &other, sizeof(QMatrix)); }
+ { memcpy(static_cast<void *>(this), static_cast<void *>(&other), sizeof(QMatrix)); }
QMatrix(const QMatrix &other) Q_DECL_NOTHROW; // = default
#endif