summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@qt.io>2024-05-17 22:48:21 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2024-05-20 16:40:11 +0000
commit077ffcebc7c40b03610fcf23428349bd5812965c (patch)
tree1f4534c74700d42e3fc58a7a607c92d973f91c1e
parentBump androix dependency to 1.13.1 (diff)
downloadqtbase-077ffcebc7c40b03610fcf23428349bd5812965c.tar.xz
qtbase-077ffcebc7c40b03610fcf23428349bd5812965c.zip
tst_QSpan: fix GCC 11 -Wmaybe-uninitialized
GCC 11 doesn't understand that 'i' isn't ever read from (because all spans created over it have size zero), but initialize it nonetheless to suppress the warning. Amends f82cf6333e4e21c96d8b6bb272392f8142ead2b7. Change-Id: Ibfb3e9b7fdcbe93c43b7873986c74b4b5a0c9e54 Reviewed-by: Ahmad Samir <a.samirh78@gmail.com> (cherry picked from commit 6736fe3a0f33d2c37927a79203999acb8ef7b343) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--tests/auto/corelib/tools/qspan/tst_qspan.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/auto/corelib/tools/qspan/tst_qspan.cpp b/tests/auto/corelib/tools/qspan/tst_qspan.cpp
index 91d2ecf739..b8fcd0cdde 100644
--- a/tests/auto/corelib/tools/qspan/tst_qspan.cpp
+++ b/tests/auto/corelib/tools/qspan/tst_qspan.cpp
@@ -173,7 +173,7 @@ void tst_QSpan::onlyZeroExtentSpansHaveDefaultCtors() const
void tst_QSpan::zeroExtentSpansMaintainADataPointer() const
{
- int i;
+ int i = 0;
QSpan<int, 0> si{&i, 0};
QCOMPARE(si.data(), &i);
check_empty_span_incl_subspans(si);