summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2023-01-02 10:50:17 +0100
committerMarc Mutz <marc.mutz@qt.io>2023-01-03 21:55:21 +0100
commit887d5eddb0e926e12841a9dbe8f425704da25e6d (patch)
treed0a7c834bf92b0a6cc62edb1df9a487dfc529057 /tests
parent69ea84fd71d66e095a4d3f581f276fe5b41964a3 (diff)
QString: use inheritance, not template aliases, for arg() constraints
For unknown reasons, using template aliases breaks on some MSVC versions and a valid arg(std::declval<QStringRef>(), std::declval<QString>()) call gets SFINAE'd out. Partially reverts e0963f7d6a31dd26629a9553c0fe00d0c8b2f22f. Add a test. Fixes: QTBUG-109723 Change-Id: I832357c91efa4caafce40b50dd76a700de2c58d7 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/corelib/text/qstring/tst_qstring.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/auto/corelib/text/qstring/tst_qstring.cpp b/tests/auto/corelib/text/qstring/tst_qstring.cpp
index 878988d425..90f7f63192 100644
--- a/tests/auto/corelib/text/qstring/tst_qstring.cpp
+++ b/tests/auto/corelib/text/qstring/tst_qstring.cpp
@@ -4876,6 +4876,9 @@ void tst_QString::arg()
QCOMPARE( s4.arg("foo", 10), QLatin1String("[ foo]") );
QCOMPARE( s4.arg("foo", -10), QLatin1String("[foo ]") );
+ // QStringRef argument in multi-arg:
+ QCOMPARE(QString("%1;%2").arg(QStringRef(), QString()), ";");
+
QString firstName( "James" );
QString lastName( "Bond" );
QString fullName = QString( "My name is %2, %1 %2" )