summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier De Cannière <olivier.decanniere@qt.io>2023-08-07 10:04:19 +0200
committerOlivier De Cannière <olivier.decanniere@qt.io>2023-08-11 09:57:28 +0000
commit6987aab2ab33e9d6d0a01cd04c9c3f8822baa95f (patch)
tree1306cd0b70d2258c5c27d8e455236ae3bff96841
parentd09a9f6de3cf672e52fd4081eec7b07b9ed0e877 (diff)
CompilerDetection: Define Q_UNREACHABLE_RETURN for MSVC
MSVC seems to emit warnings failing the build in some situations where a return statement comes after a Q_UNREACHABLE. This does not seem to happen on other compilers. The Q_UNREACHABLE_RETURN macro already exists to deal with this situation. Define it for MSVC. Change-Id: Iad06f4048e2829b1eac4f78a1053041ef72c21e7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
-rw-r--r--src/corelib/global/qcompilerdetection.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h
index 3bbb0ff4fd..3703ce346c 100644
--- a/src/corelib/global/qcompilerdetection.h
+++ b/src/corelib/global/qcompilerdetection.h
@@ -77,6 +77,7 @@
# define Q_DECL_IMPORT __declspec(dllimport)
# define QT_MAKE_UNCHECKED_ARRAY_ITERATOR(x) stdext::make_unchecked_array_iterator(x) // Since _MSC_VER >= 1800
# define QT_MAKE_CHECKED_ARRAY_ITERATOR(x, N) stdext::make_checked_array_iterator(x, size_t(N)) // Since _MSC_VER >= 1500
+# define Q_COMPILER_COMPLAINS_ABOUT_RETURN_AFTER_UNREACHABLE
#elif defined(__BORLANDC__) || defined(__TURBOC__)
# define Q_CC_BOR