diff options
author | Andreas Buhr <andreas@andreasbuhr.de> | 2021-11-10 08:57:19 +0100 |
---|---|---|
committer | Andreas Buhr <andreas.buhr@qt.io> | 2021-11-10 14:10:20 +0100 |
commit | 30a70fc6e0ffa562e27d0fc25f99187f7de71493 (patch) | |
tree | a690d706c916afddd6695ed6fa57b34fb46d33bc /tests/auto/corelib | |
parent | 6652bf2353d807f724f398a15cb22c188830f57c (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.
Pick-to: 6.2
Task-number: QTBUG-96975
Change-Id: I0180e2e6760d2809ca61e3cd8f02b04f970172a7
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Diffstat (limited to 'tests/auto/corelib')
-rw-r--r-- | tests/auto/corelib/io/qurl/tst_qurl.cpp | 7 |
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 c4bbe634c9..205a99ef1b 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 |