diff --git a/src/corelib/text/qstringconverter_base.h b/src/corelib/text/qstringconverter_base.h index f726d95b82..dd84cf8744 100644 --- a/src/corelib/text/qstringconverter_base.h +++ b/src/corelib/text/qstringconverter_base.h @@ -50,6 +50,8 @@ #include // QT_{BEGIN,END}_NAMESPACE #include // Q_DECLARE_FLAGS +#include + QT_BEGIN_NAMESPACE class QByteArrayView; @@ -77,7 +79,8 @@ public: : flags(other.flags), remainingChars(other.remainingChars), invalidChars(other.invalidChars), - d{other.d[0], other.d[1]}, + state_data{other.state_data[0], other.state_data[1], + other.state_data[2], other.state_data[3]}, clearFn(other.clearFn) { other.clearFn = nullptr; } State &operator=(State &&other) noexcept @@ -86,8 +89,7 @@ public: flags = other.flags; remainingChars = other.remainingChars; invalidChars = other.invalidChars; - d[0] = other.d[0]; - d[1] = other.d[1]; + std::memmove(state_data, other.state_data, sizeof state_data); // self-assignment-safe clearFn = other.clearFn; other.clearFn = nullptr; return *this;