From 5e908ada6759b27cd50cf860b8028f8bd0d6c94c Mon Sep 17 00:00:00 2001 From: Olivier Goffart Date: Mon, 24 Feb 2020 09:06:31 +0100 Subject: [PATCH] Fix crashes with MSVC 2019 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Apparently the compiler bug causing MSVC to mix lambdas is not fixed in MSVC 2019 Fixes: QTBUG-82405 Change-Id: Ifafde3497ff264cda931ebfba79fcef1d5130510 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Thiago Macieira --- src/corelib/kernel/qmetatype.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h index f9d7fe9f032..7e10be7def0 100644 --- a/src/corelib/kernel/qmetatype.h +++ b/src/corelib/kernel/qmetatype.h @@ -2658,8 +2658,8 @@ public: // Workaround for https://bugs.llvm.org/show_bug.cgi?id=44554 : Every lambda used for initializing // static members need a different signature for explicit instentiation #define QT_METATYPE_CONSTEXPRLAMDA(...) [](std::integral_constant = {}) constexpr __VA_ARGS__ () -#elif defined(Q_CC_MSVC) && Q_CC_MSVC < 1920 -// Workaround a bug with 'if constexpr' not working in lambda that are not generic in MSVC 2017 +#elif defined(Q_CC_MSVC) +// Workaround a bug with 'if constexpr' not working in lambda that are not generic in MSVC #define QT_METATYPE_CONSTEXPRLAMDA(...) [](auto) constexpr __VA_ARGS__ (0) #else #define QT_METATYPE_CONSTEXPRLAMDA(...) []() constexpr __VA_ARGS__ ()