summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qfuture_impl.h
diff options
context:
space:
mode:
authorVolker Hilsheimer <volker.hilsheimer@qt.io>2022-03-21 12:42:44 +0100
committerVolker Hilsheimer <volker.hilsheimer@qt.io>2022-03-21 20:41:23 +0100
commitcbf8fc0ac43365f4dd69c64ec770d8f547d772f3 (patch)
tree19e04efe5c5ca12c432c6e692a054b2426f4e4c6 /src/corelib/thread/qfuture_impl.h
parentc924c05ae226524755b1701a5a40e436a08ca2e6 (diff)
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 <sona.kurazyan@qt.io>
Diffstat (limited to 'src/corelib/thread/qfuture_impl.h')
-rw-r--r--src/corelib/thread/qfuture_impl.h2
1 files changed, 1 insertions, 1 deletions
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<std::tuple_element_t<Size, TupleType>>) {
if constexpr (Size == 1) {
- return arg;
+ return std::move(arg);
} else {
return cutTuple(std::make_tuple(std::forward<Arg>(arg), std::forward<Args>(args)...),
std::make_index_sequence<Size>());