Suppress bogus warning from gcc 12
It says:
/home/qt/qt6dev-src/qtbase/src/corelib/tools/qcontainertools_impl.h: In function ‘auto QtPrivate::sequential_erase_with_copy(Container&, const T&) [with Container = QList<void (*)()>; T = void (*)()]’:
/home/qt/qt6dev-src/qtbase/src/corelib/tools/qcontainertools_impl.h:383:14: error: ‘D.282000’ is used uninitialized [-Werror=uninitialized]
383 | const T &tCopy = CopyProxy(t);
| ^~~~~
cc1plus: all warnings being treated as errors
We can avoid storing the value into a const ref to silence this. Storing
a non-const pointer into a const reference is quite confusing anyway.
Fixes: QTBUG-123486
Pick-to: 6.5 6.6 6.7
Change-Id: I77fcd871724ce7f81b9567603dc5b4cb31f121c5
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
bb10
parent
3dba889fef
commit
4662e80755
|
|
@ -380,8 +380,7 @@ template <typename Container, typename T>
|
|||
auto sequential_erase_with_copy(Container &c, const T &t)
|
||||
{
|
||||
using CopyProxy = std::conditional_t<std::is_copy_constructible_v<T>, T, const T &>;
|
||||
const T &tCopy = CopyProxy(t);
|
||||
return sequential_erase(c, tCopy);
|
||||
return sequential_erase(c, CopyProxy(t));
|
||||
}
|
||||
|
||||
template <typename Container, typename T>
|
||||
|
|
|
|||
Loading…
Reference in New Issue