From d8e03bb02d93f9eb843923063c13162ce10079e0 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Sat, 7 May 2022 12:28:35 +0200 Subject: [PATCH] QHash: port away from std::aligned_storage It's deprecated in C++23. Just use an explicitly-aligned char array directly, wrapped in a struct to avoid decays to char*. Task-number: QTBUG-99122 Pick-to: 6.3 6.2 Change-Id: I802761c1af62efa6ffc006b07837a7deed1ea4cc Reviewed-by: Qt CI Bot Reviewed-by: Thiago Macieira --- src/corelib/tools/qhash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/tools/qhash.h b/src/corelib/tools/qhash.h index 07e2f2d355..f733e6c517 100644 --- a/src/corelib/tools/qhash.h +++ b/src/corelib/tools/qhash.h @@ -280,7 +280,7 @@ struct Span { // When a node gets inserted, the first free entry is being picked, removed // from the singly linked list and the Node gets constructed in place. struct Entry { - typename std::aligned_storage::type storage; + struct { alignas(Node) unsigned char data[sizeof(Node)]; } storage; unsigned char &nextFree() { return *reinterpret_cast(&storage); } Node &node() { return *reinterpret_cast(&storage); }