summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-05-07 12:28:35 +0200
committerMarc Mutz <marc.mutz@qt.io>2022-05-07 20:47:42 +0200
commitd8e03bb02d93f9eb843923063c13162ce10079e0 (patch)
tree2922404e8f5ecda4702240d581d593d0a2fcd9b9 /src/corelib/tools
parent38002df2065d3730defe3513f73088b444e68139 (diff)
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 <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qhash.h2
1 files changed, 1 insertions, 1 deletions
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<sizeof(Node), alignof(Node)>::type storage;
+ struct { alignas(Node) unsigned char data[sizeof(Node)]; } storage;
unsigned char &nextFree() { return *reinterpret_cast<unsigned char *>(&storage); }
Node &node() { return *reinterpret_cast<Node *>(&storage); }