summaryrefslogtreecommitdiffstats
path: root/qmake
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2022-01-22 21:07:21 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-01-25 08:59:25 +0000
commite952677c3c74b98f2aa5a01cf9cdd1944e9d237d (patch)
treef9475518b3615892a0b39ee38f130520f25da872 /qmake
parent2ba00de3d5ace56983a42ede0a651f4a3083cef7 (diff)
QMake: replace a Q_ASSERT() with a Q_UNREACHABLE()
In release mode, the Q_ASSERT() is a no-op, and Clang rightfully pointed out that, in that case, the bool ok variable will be used uninitialized. Fix by using Q_UNREACHABLE(), which has an effect in both debug and release builds. Change-Id: I33480aabe1c5233d1caddf9404f475ca9fcb8eaf Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit be0dc7fbb8c0c1ead7eeeb9aefea6c081beeacdc) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'qmake')
-rw-r--r--qmake/library/qmakeparser.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/qmake/library/qmakeparser.cpp b/qmake/library/qmakeparser.cpp
index 52e4187dbb..a4671bc692 100644
--- a/qmake/library/qmakeparser.cpp
+++ b/qmake/library/qmakeparser.cpp
@@ -1549,7 +1549,8 @@ static bool getBlock(const ushort *tokens, int limit, int &offset, QString *outS
ok = getSubBlock(tokens, limit, offset, outStr, indent, "block");
break;
default:
- Q_ASSERT(!"unhandled token");
+ // unhandled token
+ Q_UNREACHABLE();
}
}
if (!ok)