From 7eeda336b4ab45e6869f848d6378043337cd37a1 Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Sun, 19 Sep 2021 11:47:10 +0200 Subject: Switch a comma operator to a IILE A comma operator results in a discarded-value expression, meaning the compiler is going to complain the moment we mark QMutexLocker as nodiscard. Turn the comma into a functionally equivalent IILE. Change-Id: I33826902c8471016490aac25160b70c609dafd90 Reviewed-by: Volker Hilsheimer --- src/corelib/plugin/qlibrary.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/corelib/plugin/qlibrary.cpp') diff --git a/src/corelib/plugin/qlibrary.cpp b/src/corelib/plugin/qlibrary.cpp index c6af4f9636..b67c3b6439 100644 --- a/src/corelib/plugin/qlibrary.cpp +++ b/src/corelib/plugin/qlibrary.cpp @@ -548,7 +548,7 @@ void QLibraryPrivate::setLoadHints(QLibrary::LoadHints lh) QObject *QLibraryPrivate::pluginInstance() { // first, check if the instance is cached and hasn't been deleted - QObject *obj = (QMutexLocker(&mutex), inst.data()); + QObject *obj = [&](){ QMutexLocker locker(&mutex); return inst.data(); }(); if (obj) return obj; -- cgit v1.2.3