qt5base-lts/tests/auto/corelib
Ahmad Samir 3a9526468c Handle a couple of GCC 13 warnings about dangling references
There are two temporaries, reply.arguments() returns a temporary QList
and list.at(0) returns a temporary reference to the first element. The
local reference variable would only extend the lifetime of the temporary
object it's bound to, list.at(0), but not the temporary list itself.
Even though this a false positive in this case because QList is
implicilty shared, the compiler can't tell the difference and the fix is
simple.

tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp:1845:21:
warning: possibly dangling reference to a temporary
[-Wdangling-reference]
 1845 |     const QVariant &retval = reply.arguments().at(0);
      |                     ^~~~~~
tests/auto/dbus/qdbusabstractadaptor/tst_qdbusabstractadaptor.cpp:1845:50:
note: the temporary was destroyed at the end of the full expression
‘QDBusMessage::arguments() const().QList<QVariant>::at(0)’
 1845 |     const QVariant &retval = reply.arguments().at(0);
      |                              ~~~~~~~~~~~~~~~~~~~~^~~

Pick-to: 6.6 6.5 5.15
Change-Id: I03d54b56769cbd0f9f1165e4679ec4947267181a
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2023-06-28 01:09:58 +03:00
..
animation QPauseAnimation test: add QNX to platforms that might fail 2023-05-25 14:06:50 +02:00
global Short live Q_NODISCARD_(CTOR_)X! 2023-06-22 18:20:09 +02:00
io QStorageInfo/Linux: use readAll() with /proc/self/mountinfo 2023-06-27 02:28:21 +03:00
ipc IPC: tst_QNativeIpcKey: rename duplicate row in test 2023-04-28 22:30:13 -05:00
itemmodels QAbstractProxyModel: delay headerDataChanged emissions when inserting/removing rows/columns 2023-06-23 16:24:27 +02:00
kernel Pacify MSVC compiler incorrectly warning about unused variable 2023-06-22 13:20:26 +00:00
mimetypes QMimeDatabase: de-duplicate some code in the unittests 2023-05-07 14:29:28 +03:00
platform Don't add prefix for BaseName 2023-06-16 22:54:36 +03:00
plugin QLibraryPrivate: Actually merge load hints 2023-06-20 15:41:20 +02:00
serialization QXmlStreamReader: make fastScanName() indicate parsing status to callers 2023-06-28 00:11:21 +03:00
text Skip the tst_QRegularExpression::threadSafety test on WASM temporarily 2023-06-26 11:58:27 +01:00
thread Handle a couple of GCC 13 warnings about dangling references 2023-06-28 01:09:58 +03:00
time Add test-cases for QDate::{start,end}OfDay() at QDateTime's bounds 2023-05-15 14:02:41 +02:00
tools Add q20::erase_if(std::vector, pred) and erase(vector, val) 2023-06-22 21:13:31 +00:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00