QFuture: avoid warnings about unreachable code with /W4 in MSVC
... when instantiating the MetaTypeQFutureHelper for QFuture<void>. Simply enabling /W4 for tst_qfuture also generates this warning, but also much more. So I'm not providing any unit-test here. Amends 90d9a86c2e762c9426d0facbd54ed5dbff574ecd. Fixes: QTBUG-133406 Pick-to: 6.9 6.9.0 6.8 6.5 Change-Id: I22a53b872818763b80f333f597ddd19a1c1e30ac Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
550db195af
commit
ff6bf61b17
@ -438,12 +438,13 @@ template<typename T>
|
|||||||
struct MetaTypeQFutureHelper<QFuture<T>>
|
struct MetaTypeQFutureHelper<QFuture<T>>
|
||||||
{
|
{
|
||||||
static bool registerConverter() {
|
static bool registerConverter() {
|
||||||
if constexpr (std::is_same_v<T, void>)
|
if constexpr (std::is_same_v<T, void>) {
|
||||||
return false;
|
return false;
|
||||||
|
} else {
|
||||||
return QMetaType::registerConverter<QFuture<T>, QFuture<void>>(
|
return QMetaType::registerConverter<QFuture<T>, QFuture<void>>(
|
||||||
[](const QFuture<T> &future) { return QFuture<void>(future); });
|
[](const QFuture<T> &future) { return QFuture<void>(future); });
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace QtPrivate
|
} // namespace QtPrivate
|
||||||
|
Loading…
x
Reference in New Issue
Block a user