qt5base-lts/tests/auto/corelib/tools
Marc Mutz 5e48a51608 Long live QAtomicScopedValueRollback (private API)!
QScopedValueRollback has a few users that apply it on QAtomicInt,
which happens to work as QAtomicInt is copy-constructible and its
ctors are implicit.

But that's of course nonsense. We don't need to store the oldValue in
an atomic, nor do we need to pass the new value into the ctor as an
atomic.

So, add a QAtomicScopedValueRollback which works on std::atomic as
well as the Qt atomics, but distinguishes between the reference (which
is atomic) and the value (which isn't), and use it in one of the
users, tst_QList.

Keep it private until we know whether there's an actual need for this.

The test is a copy of tst_qscopedvaluefallback, so the occasional
oddity (like atomic op*=) should be ignored.

Task-number: QTBUG-103835
Change-Id: I3c05b3e51f465698657a02ca5521ed465386e9a6
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
2022-05-31 19:25:52 +02:00
..
collections Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
containerapisymmetry Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qalgorithms Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qarraydata Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qatomicscopedvaluerollback Long live QAtomicScopedValueRollback (private API)! 2022-05-31 19:25:52 +02:00
qbitarray Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qcache Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qcommandlineparser Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qcontiguouscache Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qcryptographichash Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qduplicatetracker Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qeasingcurve Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qexplicitlyshareddatapointer Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qflatmap Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qfreelist Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qhash Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qhashfunctions Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qhashseed Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qline Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qlist Long live QAtomicScopedValueRollback (private API)! 2022-05-31 19:25:52 +02:00
qmacautoreleasepool Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qmakearray Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qmap Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qmargins Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qmessageauthenticationcode Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qoffsetstringarray Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qpair Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qpoint Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qpointf Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qqueue Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qrect Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qringbuffer Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qscopedpointer Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qscopedvaluerollback Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qscopeguard Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qset Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qsharedpointer Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qsize Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qsizef Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qstl Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qtaggedpointer Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qtimeline Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qvarlengtharray Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
qversionnumber Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
CMakeLists.txt Long live QAtomicScopedValueRollback (private API)! 2022-05-31 19:25:52 +02:00