From 29e269567610aff4e26738aff507e58e23900133 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Mon, 9 Dec 2024 17:32:16 +0100 Subject: [PATCH] tst_QStringApiSymmetry: test QByteArray(weak)/QByteArrayView overloading Adding it here since this test case already has all the infrastructure for the overload test. Pick-to: 6.8 6.5 Change-Id: I2d7fff9d2d82fed3db2446690a354f939c9a37fc Reviewed-by: Ivan Solovev (cherry picked from commit 140dac92f2a8ee1f54843f69be4026900a049ee7) Reviewed-by: Qt Cherry-pick Bot --- .../qstringapisymmetry/tst_qstringapisymmetry.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp index 47ad8393e2d..a84b9283381 100644 --- a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp +++ b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp @@ -1366,6 +1366,10 @@ Q_WEAK_OVERLOAD auto overload_s_bav(const QString &s) { return s; } auto overload_s_bav(QByteArrayView s) { return s; } +Q_WEAK_OVERLOAD +auto overload_ba_bav(const QByteArray &s) { return s; } +auto overload_ba_bav(QByteArrayView s) { return s; } + } // unnamed namespace template @@ -1437,6 +1441,15 @@ void tst_QStringApiSymmetry::overload() overload_s_bav(CT()); } } + + if constexpr (std::is_convertible_v || std::is_convertible_v) { + overload_ba_bav(t); + overload_ba_bav(ct); + if constexpr (!std::is_array_v) { + overload_ba_bav(T()); + overload_ba_bav(CT()); + } + } QT_WARNING_POP }