diff options
author | Ahmad Samir <a.samirh78@gmail.com> | 2023-03-19 20:37:11 +0200 |
---|---|---|
committer | Ahmad Samir <a.samirh78@gmail.com> | 2023-04-08 13:21:24 +0200 |
commit | b58606ed851e21b64b72c8f86926d5e5adb56ec7 (patch) | |
tree | d61069f80cb59e6431751296d0c44a1eac5af886 /tests/auto/corelib/text | |
parent | 40045aeec88afdd2f62629042352b0d17fadcf0b (diff) |
tst_qstringapisymmetry: silence a GCC warning
GCC complains:
inlined from ‘constexpr QAnyStringView::QAnyStringView(const Container&) [with Container = QVarLengthArray<QChar, 1023>; typename std::enable_if<disjunction_v<QtPrivate::IsContainerCompatibleWithQStringView<T, void>, QtPrivate::IsContainerCompatibleWithQUtf8StringView<T, void> >, bool>::type <anonymous> = true]’ at src/corelib/text/qanystringview.h:215:64,
inlined from ‘void tst_QStringApiSymmetry::overload() [with T = QVarLengthArray<QChar, 1023>]’ 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<Char>(str, len)}
| ~~~~~~~~~~~~~~~~^~~~~~~~~~
Clang doesn't warn about this.
Change-Id: I3476236630e886b087856acd22054bfb35deb451
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'tests/auto/corelib/text')
-rw-r--r-- | tests/auto/corelib/text/qstringapisymmetry/tst_qstringapisymmetry.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
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() |