summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2020-11-16 15:36:25 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2020-11-27 13:26:52 +0100
commit085678a75e956b9b7b6015c79b448095cd7d406c (patch)
tree5aac29bfbc07e04a7bb768d91a0fbfd51b8f349e /src/corelib
parent4785e39156312c995c39e68c8f80f2efba71c49f (diff)
Mark two impossible code-paths with Q_UNREACHABLE
Change-Id: I8c04f512b078d4c13d759854b65f4d39b7b80e75 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/text/qlocale.cpp2
-rw-r--r--src/corelib/text/qlocale_tools.cpp3
2 files changed, 3 insertions, 2 deletions
diff --git a/src/corelib/text/qlocale.cpp b/src/corelib/text/qlocale.cpp
index a3429ec9f8..3ce1f501c4 100644
--- a/src/corelib/text/qlocale.cpp
+++ b/src/corelib/text/qlocale.cpp
@@ -558,7 +558,7 @@ bool qt_splitLocaleName(QStringView name, QStringView *lang, QStringView *script
state = NoState;
break;
case NoState: // Precluded by loop condition !
- Q_ASSERT(!"QLocale: This should never happen");
+ Q_UNREACHABLE();
break;
}
}
diff --git a/src/corelib/text/qlocale_tools.cpp b/src/corelib/text/qlocale_tools.cpp
index 4421d40340..a8f63a5998 100644
--- a/src/corelib/text/qlocale_tools.cpp
+++ b/src/corelib/text/qlocale_tools.cpp
@@ -530,7 +530,8 @@ QString qulltoa(qulonglong number, int base, const QStringView zero)
number /= base;
}
- } else {
+ } else { // zero should always be either a non-surrogate or a surrogate pair:
+ Q_UNREACHABLE();
return QString();
}