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>
This commit is contained in:
parent
e1767a63cb
commit
077ffcebc7
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user