QXmlAttributes: fix UB (uninit'ed read) on unused d member


The member wasn't initialized, so swap() and, potentially, the
=default'ed move and copy SMFs read uninitialized bytes.

The only good thing here was that the default ctor was out-of-line, so
most TUs can't see the UB.

Fix by init'ing it to nullptr and removing its swapping from
member-swap. One could argue that the latter is sufficient, since
compilers shouldn't insert UB into their own generated functions, but
better safe than sorry.

Schedule its removal for Qt 7.

As a drive-by, replace the Q_UNUSED() with a Q_DECL_UNUSED_MEMBER and
rename the member d → unusable. This will also catch references in
older branches since removed in younger ones.

Pick-to: 6.12 6.11 6.8 6.5
Coverity-Id: 11422
Change-Id: I2cd2d9162c973073592263296ebc8d752adc5520
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
commitabd57c35aafcf808d2da3ad4fa46511da6ce548f
parent96e97ce36c7f7e79cfb2ecba170094cce8ea0fc3
authorMarc Mutz <marc.mutz@qt.io>
committerMarc Mutz <marc.mutz@qt.io>
commit timeMon, 7 Sep 2026 09:08:45 +0000