From b58606ed851e21b64b72c8f86926d5e5adb56ec7 Mon Sep 17 00:00:00 2001 From: Ahmad Samir Date: Sun, 19 Mar 2023 20:37:11 +0200 Subject: tst_qstringapisymmetry: silence a GCC warning MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC complains: inlined from ‘constexpr QAnyStringView::QAnyStringView(const Container&) [with Container = QVarLengthArray; typename std::enable_if, QtPrivate::IsContainerCompatibleWithQUtf8StringView >, bool>::type = true]’ at src/corelib/text/qanystringview.h:215:64, inlined from ‘void tst_QStringApiSymmetry::overload() [with T = QVarLengthArray]’ at /home/ahmad/devo/qt6-git/qtbase-qglobal/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp:1178:17: src/corelib/text/qanystringview.h:187:47: warning: ‘t’ may be used uninitialized [-Wmaybe-uninitialized] 187 | : m_data{str}, m_size{encodeType(str, len)} | ~~~~~~~~~~~~~~~~^~~~~~~~~~ Clang doesn't warn about this. Change-Id: I3476236630e886b087856acd22054bfb35deb451 Reviewed-by: Thiago Macieira --- .../auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp') diff --git a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp index 378ca31e8a..0d3797b1c3 100644 --- a/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp +++ b/tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp @@ -1170,6 +1170,10 @@ void tst_QStringApiSymmetry::overload() // check the common overload sets defined above to be free of ambiguities // for arguments of type T + QT_WARNING_PUSH + // GCC complains about "t" and "ct" + QT_WARNING_DISABLE_GCC("-Wmaybe-uninitialized") + using CT = const T; T t = {}; @@ -1218,6 +1222,7 @@ void tst_QStringApiSymmetry::overload() overload_sr_v(CT()); } } + QT_WARNING_POP } void tst_QStringApiSymmetry::overload_special() -- cgit v1.2.3