qt5base-lts/tests/auto
Marc Mutz 277c23956c tst_qobjectrace: fix potential UB (something with pointers and new)
The current [basic.life] wording seems to cover the existing code, but
IIRC, older versions of [basic.life] were not so relaxed. In
particular, while not completely pertinent, the second placement new
is awfully similar to http://eel.is/c++draft/ptr.launder#example-1

Just make all of this SEP and use std::optional. That way, the code
gets simpler, too, plus we get rid of the last use of C++23-deprecated
std::aligned_storage.

The reset() before the 2nd emplace() isn't necessary, but, in a test,
it doesn't hurt, either, and keeps code readers from guessing whether
the first-emplaced object's dtor is actually properly run (it is).

Pick-to: 6.3 6.2
Fixes: QTBUG-99122
Change-Id: If31a46f8be3a74499f1176133029d097faf7dfe9
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2022-05-07 18:47:48 +00:00
..
bic/data Add BC files for 6.2.0 2022-01-07 13:31:38 +00:00
cmake CMake: Add deployment auto test 2022-03-16 15:56:17 +01:00
concurrent Tests: Do not depend on transitive includes 2022-03-17 17:14:37 +01:00
corelib Endian: Provide special integer bitfield unions 2022-05-07 08:37:42 +02:00
dbus Add test-helper as dependency to tst_qdbusinterface 2022-05-04 12:14:49 +00:00
gui Optimize the QPalette::resolve from the other palette 2022-04-28 09:24:39 +02:00
guiapplauncher Move QStateMachine from QtCore to QtScxml 2020-08-24 20:10:25 +02:00
network Blacklist: test cases blacklisted in tst_QTcpServer: 2022-05-04 05:08:37 +00:00
opengl Remove the qmake project files 2021-01-07 15:32:28 +01:00
other tst_qobjectrace: fix potential UB (something with pointers and new) 2022-05-07 18:47:48 +00:00
printsupport QtBase: replace windows.h with qt_windows.h 2021-11-23 12:53:46 +08:00
shared Remove false Q_UNREACHABLE from shaping code 2021-02-03 09:44:44 +01:00
sql Replace uses of _qba with _ba 2022-04-07 19:30:17 +02:00
testlib Replace uses of _qs with _s in tests 2022-04-07 19:30:17 +02:00
tools uic: use C string literals for setObjectName() 2022-03-18 18:35:03 +01:00
widgets Blacklist: test cases blacklisted in tst_QDockWidget: 2022-05-04 05:08:34 +00:00
xml Replace remaining uses of deprecated _qs with _s 2022-05-02 12:23:44 +02:00
CMakeLists.txt Don't build tests/auto/tools when cross-compiling 2021-10-07 08:03:40 +02:00
network-settings.h Fix check for IPV6 support without certain features 2022-02-28 22:08:21 +00:00