From 1bdf5059ceae7b202f015728bf8817b644e2e5fc Mon Sep 17 00:00:00 2001 From: Tim Blechmann Date: Fri, 7 Mar 2025 11:40:59 +0800 Subject: [PATCH] unreachable: silence warning with clang-cl clang-cl does not warn about return after unreachable, but would warn about the unused variable after return. Pick-to: 6.8 6.9 Change-Id: Ia0fcff4f536d51d56eb915a9130cc3f72437d8d1 Reviewed-by: Thiago Macieira --- src/corelib/global/qcompilerdetection.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index a5c7cf4a912..df27cbf10c8 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -78,7 +78,9 @@ # if _MSC_VER < 1938 // stdext is deprecated since VS 2022 17.8 # define QT_MAKE_CHECKED_ARRAY_ITERATOR(x, N) stdext::make_checked_array_iterator(x, size_t(N)) // Since _MSC_VER >= 1500 # endif -# define Q_COMPILER_COMPLAINS_ABOUT_RETURN_AFTER_UNREACHABLE +# ifdef Q_CC_MSVC_ONLY +# define Q_COMPILER_COMPLAINS_ABOUT_RETURN_AFTER_UNREACHABLE +# endif #elif defined(__BORLANDC__) || defined(__TURBOC__) # define Q_CC_BOR