qt6-bb10/tests/auto/other
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
..
android Add tests for QAndroidApplication's sdkVersion and activity 2021-05-13 01:41:36 +03:00
gestures Tests: Do not depend on transitive includes 2022-03-17 17:14:37 +01:00
languagechange Remove the qmake project files 2021-01-07 15:32:28 +01:00
macgui Remove QEXPECT_FAIL from passing test 2021-03-31 10:20:07 +02:00
macnativeevents Remove the qmake project files 2021-01-07 15:32:28 +01:00
macplist Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
networkselftest Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
qabstractitemmodelutils Another round of replacing 0 with nullptr 2020-10-07 23:02:47 +02:00
qaccessibility Windows QPA: Fix slowdown with large table/tree views with accessibility 2022-03-31 09:04:09 -03:00
qaccessibilitylinux Remove .prev_CMakeLists.txt files 2021-01-12 20:59:13 +01:00
qaccessibilitymac Stabilize tst_QAccessibilityMac 2021-11-26 14:22:05 +01:00
qcomplextext Remove the qmake project files 2021-01-07 15:32:28 +01:00
qfocusevent QPA: Set focus reason when window activation changes focus 2021-12-03 08:15:29 +01:00
qnetworkaccessmanager_and_qprogressdialog CI: Add docker support for qnetworkaccessmanager_and_qprogressdialog test 2022-03-30 19:33:08 +02:00
qobjectrace tst_qobjectrace: fix potential UB (something with pointers and new) 2022-05-07 18:47:48 +00:00
qprocess_and_guieventloop Remove conditioning on Android embedded 2021-09-17 17:30:14 +02:00
qsharedpointer_and_qwidget tests: Remove unused SRCDIR defines 2021-08-17 12:41:57 +00:00
qvariant_common Split up the QMetaType unit test 2021-02-09 14:27:20 +01:00
sessionmanagement_macos Remove the qmake project files 2021-01-07 15:32:28 +01:00
toolsupport Android: unblacklist tst_toolsupport::offsets 2022-03-04 02:37:11 +01:00
xkbkeyboard Remove the qmake project files 2021-01-07 15:32:28 +01:00
CMakeLists.txt Fix tst_qaccessibility on Android 2022-02-25 13:52:33 +01:00