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>
This commit is contained in:
Edward Welbourne 2020-11-16 15:36:25 +01:00
parent 4785e39156
commit 085678a75e
2 changed files with 3 additions and 2 deletions

View File

@ -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;
}
}

View File

@ -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();
}