summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndreas Buhr <andreas@andreasbuhr.de>2021-11-10 08:57:19 +0100
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-11-10 13:10:30 +0000
commit446b9909e561b96fe157aef17bab1b6ae95d33b0 (patch)
tree5e670ceb40f501bb3d28aa1568754e70d4f23653
parentf7227a7fcabfe17260ccbb6610b1a105844c341f (diff)
Workaround MSVC 2022 bug about QString::replace
MSVC 2022 (17.0.0) complains about "'QString::replace': 12 overloads have no legal conversion for 'this' pointer". This is a compiler bug. It is reported to MS. Still we workaround it here so that qtbase can be built with MSVC 2022. Task-number: QTBUG-96975 Change-Id: I0180e2e6760d2809ca61e3cd8f02b04f970172a7 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io> (cherry picked from commit 30a70fc6e0ffa562e27d0fc25f99187f7de71493) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--tests/auto/corelib/io/qurl/tst_qurl.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/auto/corelib/io/qurl/tst_qurl.cpp b/tests/auto/corelib/io/qurl/tst_qurl.cpp
index dae137cf10..333a842584 100644
--- a/tests/auto/corelib/io/qurl/tst_qurl.cpp
+++ b/tests/auto/corelib/io/qurl/tst_qurl.cpp
@@ -1329,12 +1329,15 @@ void tst_QUrl::fromLocalFile_data()
<< QString(suffix);
#ifdef Q_OS_WIN32
// debackslashification only happens on Windows
+ QString suffixWithBackslashes(suffix);
+ suffixWithBackslashes.replace('/', '\\');
+
QTest::addRow("windows-backslash-unc-%s", pathDescription)
- << QString(QString("//somehost") + suffix).replace('/', '\\')
+ << QString(QString("\\\\somehost") + suffixWithBackslashes)
<< QString("file://somehost") + suffix
<< QString(suffix);
QTest::addRow("windows-backslash-extlen-%s", pathDescription)
- << QString(QString("//?") + suffix).replace('/', '\\')
+ << QString(QString("\\\\?") + suffixWithBackslashes)
<< QString("file:////%3F") + suffix
<< QString("//?") + suffix;
#endif