diff options
author | Marc Mutz <[email protected]> | 2025-06-30 17:18:09 +0200 |
---|---|---|
committer | Marc Mutz <[email protected]> | 2025-07-01 13:56:03 +0200 |
commit | 6eb65b75fe3cbc0ea7092f80b5a1d7280400e2a0 (patch) | |
tree | 0fac865f9b735c7cf5c4b7bc6151279b425544cd /src/gui/util/qundostack.h | |
parent | ad080afa7fb00b0672e51e8315596d4540107d64 (diff) |
The usual whack-a-mole: libstdc++'s std::optional implementation like
to throw a -Wmaybe-uninitalized warning when the default ctor is used.
Says GCC 15 (kinda cryptically):
In function ‘constexpr void qt_ptr_swap(T*&, T*&) [with T = QFileInfoPrivate]’,
inlined from ‘void Qt::qt_ptr_swap(totally_ordered_wrapper<QFileInfoPrivate*>&, totally_ordered_wrapper<QFileInfoPrivate*>&)’ at qcomparehelpers.h:1145:18,
inlined from ‘void QSharedDataPointer<T>::swap(QSharedDataPointer<T>&) [with T = QFileInfoPrivate]’ at qshareddata.h:97:18,
inlined from ‘void QFileInfo::swap(QFileInfo&)’ at qfileinfo.h:62:17,
inlined from ‘QFileInfo& QFileInfo::operator=(QFileInfo&&)’ at qfileinfo.h:59:5,
inlined from ‘constexpr void std::_Optional_payload_base<_Tp>::_M_move_assign(std::_Optional_payload_base<_Tp>&&) [with _Tp = QFileInfo]’ at optional:193:19,
inlined from ‘constexpr std::_Optional_payload<_Tp, true, false, false>& std::_Optional_payload<_Tp, true, false, false>::operator=(std::_Optional_payload<_Tp, true, false, false>&&) [with _Tp = QFileInfo]’ at optional:442:22,
inlined from ‘constexpr std::_Optional_payload<_Tp, false, _Copy, _Move>& std::_Optional_payload<_Tp, false, _Copy, _Move>::operator=(std::_Optional_payload<_Tp, false, _Copy, _Move>&&) [with _Tp = QFileInfo; bool _Copy = false; bool _Move = false]’ at optional:458:26,
inlined from ‘constexpr std::_Optional_base<_Tp, <anonymous>, <anonymous> >& std::_Optional_base<_Tp, <anonymous>, <anonymous> >::operator=(std::_Optional_base<_Tp, <anonymous>, <anonymous> >&&) [with _Tp = QFileInfo; bool <anonymous> = false; bool <anonymous> = false]’ at optional:535:23,
inlined from ‘constexpr std::optional<QFileInfo>& std::optional<QFileInfo>::operator=(std::optional<QFileInfo>&&)’ at optional:778:11,
inlined from ‘QDirEntryInfo& QDirEntryInfo::operator=(QDirEntryInfo&&)’ at qdirentryinfo_p.h:24:7,
inlined from ‘void QDirListingPrivate::advance()’ at qdirlisting.cpp:360:30:
qswap.h:32:9: warning: ‘*(QFileInfoPrivate**)((char*)&<unnamed> + offsetof(QDirEntryInfo, QDirEntryInfo::fileInfoOpt.std::optional<QFileInfo>::<unnamed>.std::_Optional_base<QFileInfo, false, false>::_M_payload.std::_Optional_payload<QFileInfo, false, false, false>::<unnamed>.std::_Optional_payload<QFileInfo, true, false, false>::<unnamed>.std::_Optional_payload_base<QFileInfo>::_M_payload))’ may be used uninitialized [-Wmaybe-uninitialized]
32 | lhs = rhs;
| ~~~~^~~~~
qdirlisting.cpp: In member function ‘void QDirListingPrivate::advance()’:
qdirlisting.cpp:360:30: note: ‘<anonymous>’ declared here
360 | entryInfo = {};
| ^
To fix, use the std::nullopt_t ctor instead.
Three year old list of upstream bugreports:
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80635
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86465
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100115
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102801
- https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105749
IOW: they (still) don't seem to care much.
Amends c39a0d1e8956e042139ce3065681e4c5d07412f3.
Pick-to: 6.10 6.9 6.8
Change-Id: I6c724142116f78f0ba8ed311f46b80091e995d74
Reviewed-by: Ahmad Samir <[email protected]>
Diffstat (limited to 'src/gui/util/qundostack.h')
0 files changed, 0 insertions, 0 deletions