From cbf8fc0ac43365f4dd69c64ec770d8f547d772f3 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Mon, 21 Mar 2022 12:42:44 +0100 Subject: [PATCH] Fix warning in tst_qfuture Explicitly move the argument into the return value to silence: qfuture_impl.h:153:20: warning: local variable 'arg' will be copied despite being returned by name [-Wreturn-std-move] return arg; ^~~ [...] qfuture_impl.h:153:20: note: call 'std::move' explicitly to avoid copying Change-Id: I49fab7c31efb7d809182c8d56e6a5ed8f05a5622 Reviewed-by: Sona Kurazyan --- src/corelib/thread/qfuture_impl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/thread/qfuture_impl.h b/src/corelib/thread/qfuture_impl.h index 4c68a527da..5af37b970e 100644 --- a/src/corelib/thread/qfuture_impl.h +++ b/src/corelib/thread/qfuture_impl.h @@ -150,7 +150,7 @@ auto createTuple(Arg &&arg, Args &&... args) constexpr auto Size = sizeof...(Args); // One less than the size of all arguments if constexpr (QtPrivate::IsPrivateSignalArg>) { if constexpr (Size == 1) { - return arg; + return std::move(arg); } else { return cutTuple(std::make_tuple(std::forward(arg), std::forward(args)...), std::make_index_sequence());