diff options
author | Yuhang Zhao <2546789017@qq.com> | 2022-08-25 10:36:48 +0800 |
---|---|---|
committer | Marc Mutz <marc.mutz@qt.io> | 2022-10-15 13:34:20 +0000 |
commit | 8cb832090a8a0e7226904561f97c6de954d752ed (patch) | |
tree | b6212a59462b3eff672ec67b92ce9f0fe99afd9c /tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp | |
parent | 0a4d0ac013c276f32c23d9a7f51d88a853fc60df (diff) |
MSVC: Enable all possible conformance checks
For the full list, please refer to [1].
Needed to change the qstringapisymmetry unit test:
In theory we don't need the array to be static and it did compile
without any problems so far, indeed. However, with this patch applied,
MSVC complains that the lambda function below can't access the array.
I don't understand why, because we use [&] in the lambda and it should
capture all the variables in theory, but in reality it failed to
capture this variable in the end. And making the variable static
solves this issue. Maybe it's a MSVC bug.
Already tested locally. Most Qt repos build without any issues,
only very few repos are not tested, as my local environment
can't build them.
[1] https://docs.microsoft.com/en-us/cpp/build/reference/zc-conformance?view=msvc-170
Change-Id: I658427aa171ee1ae26610d0c68640b2f50789f15
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp')
-rw-r--r-- | tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp index e4f3759c6f..deda275c8a 100644 --- a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp +++ b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp @@ -2625,7 +2625,7 @@ void tst_QStringApiSymmetry::toNumberWithBases_data() QTest::addColumn<qint64>("result"); QTest::addColumn<bool>("ok"); - constexpr struct { + static constexpr struct { const char prefix[3]; int base; } bases[] = { |