Check that all string-like types implement compareThreeWay() as a (hidden) friend function. This test revealed some problems: because QByteArrayView is implicitly constructible from QLatin1StringView, the qCompareThreeWay() call sometimes picked the compareThreeWay() overloads with QByteArrayView instead of picking the "reversed" overloads that use QLatin1StringView. This was leading to wrong results, because QByteArrayView is interpreted as utf-8 data, not latin-1. Explicitly add the missing compareThreeWay() and comparesEqual() overloads. Note that relational operators were never affected by this problem, because in C++17 mode we explicitly generate the reversed versions, and in C++20 mode the compiler does that for us. Task-number: QTBUG-117661 Change-Id: Ia96af59c60ebf2fae6cf2a49231d6b6f401aceaa Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> |
||
|---|---|---|
| .. | ||
| .gitignore | ||
| CMakeLists.txt | ||
| tst_qstringapisymmetry.cpp | ||