Commit a791032
QLocale/Win: don't move from an lvalue
The nullIfEmpty() function took its argument by universal reference,
but then unconditionally moved from it into a QVariant. As long as
QVariant didn't have ctors from rvalue-refs, this wasn't an actual
move, but still a copy (std::move() doesn't move, it's an
lvalue-to-rvalue (xvalue) cast). With the implementation of move-ctors
for QVariant (QTBUG-53265), this suddenly becomes a move and, in
zeroDigit(), moves away from the 'zero' member.
Issue location found by Copilot.
Fix by forwarding from the universal reference instead of
moving. Contrary to what Copilot keeps telling me, this _is_ the
correct fix.
Amends 385626d.
Pick-to: 6.10 6.8 6.5
Change-Id: I91cba49f39506d403b3f7a21c9f4b58fd91af8d5
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
(cherry picked from commit ad0b53f)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>1 parent aeb47c4 commit a791032
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| |||
0 commit comments