diff --git a/src/corelib/tools/qvarlengtharray.h b/src/corelib/tools/qvarlengtharray.h index fccdfad081d..a70fc75fcfd 100644 --- a/src/corelib/tools/qvarlengtharray.h +++ b/src/corelib/tools/qvarlengtharray.h @@ -293,11 +293,7 @@ private: qsizetype a; // capacity qsizetype s; // size T *ptr; // data - union { - char array[Prealloc * sizeof(T)]; - qint64 q_for_alignment_1; - double q_for_alignment_2; - }; + std::aligned_storage_t array[Prealloc]; bool isValidIterator(const const_iterator &i) const {