From b8431bef376cc226a51f10cab96c6c672ea1b519 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 3 Jan 2022 18:13:28 +0100 Subject: [PATCH] QRandom: remove dead pre-C++11 code All compilers support C++11 unrestricted unions in Qt 6. Gets rid of another instance of to-be-deprecated-in-C++-23 std::aligned_storage. Pick-to: 6.3 Task-number: QTBUG-99122 Change-Id: I5e6dc025893c79d0c516fc2d3801ec071615b9cc Reviewed-by: Thiago Macieira --- src/corelib/global/qrandom.h | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/corelib/global/qrandom.h b/src/corelib/global/qrandom.h index 7639937da4..aef2677c13 100644 --- a/src/corelib/global/qrandom.h +++ b/src/corelib/global/qrandom.h @@ -229,15 +229,9 @@ private: union Storage { uint dummy; -#ifdef Q_COMPILER_UNRESTRICTED_UNIONS RandomEngine twister; RandomEngine &engine() { return twister; } const RandomEngine &engine() const { return twister; } -#else - std::aligned_storage::type buffer; - RandomEngine &engine() { return reinterpret_cast(buffer); } - const RandomEngine &engine() const { return reinterpret_cast(buffer); } -#endif static_assert(std::is_trivially_destructible::value, "std::mersenne_twister not trivially destructible as expected");