From 1af3e2bd91fb455e3f93c2acf20d102a61925ce6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B8ger=20Hanseg=C3=A5rd?= Date: Wed, 26 Jun 2024 19:47:19 +0200 Subject: [PATCH] Fix ASAN crash at at startup with Gallery widgets example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It is not clear how this change fixes the issue. Maybe it is bad code generation by the MSVC 2022 compiler? Fixes: QTBUG-126702 Change-Id: I56f4be789aa3d1783d6305b59339984c99454bc7 Reviewed-by: Jan Arve Sæther (cherry picked from commit aa3e6ab27dacaef339997c85d3859bcf077b6db7) Reviewed-by: Qt Cherry-pick Bot --- src/gui/kernel/qguivariant.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qguivariant.cpp b/src/gui/kernel/qguivariant.cpp index 78a1660355..522f4cad5d 100644 --- a/src/gui/kernel/qguivariant.cpp +++ b/src/gui/kernel/qguivariant.cpp @@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE namespace { // NOLINTNEXTLINE(cppcoreguidelines-virtual-class-destructor): this is not a base class -static constexpr struct : QMetaTypeModuleHelper +struct QVariantGuiHelper : QMetaTypeModuleHelper { #define QT_IMPL_METATYPEINTERFACE_GUI_TYPES(MetaTypeName, MetaTypeId, RealName) \ QT_METATYPE_INTERFACE_INIT(RealName), @@ -135,7 +135,9 @@ static constexpr struct : QMetaTypeModuleHelper } return false; } -} qVariantGuiHelper; +}; + +static constexpr QVariantGuiHelper qVariantGuiHelper; } // namespace used to hide QVariant handler