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>
bb10
Volker Hilsheimer 2022-03-21 12:42:44 +01:00
parent c924c05ae2
commit cbf8fc0ac4
1 changed files with 1 additions and 1 deletions

View File

@ -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>());