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.0 6.8 6.5 Change-Id: I22a53b872818763b80f333f597ddd19a1c1e30ac Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit ff6bf61b17ee4fc8ca11e016242d7c3399a02045) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
01d1a2265c
commit
7a7c7322fa
@ -437,12 +437,13 @@ template<typename T>
|
||||
struct MetaTypeQFutureHelper<QFuture<T>>
|
||||
{
|
||||
static bool registerConverter() {
|
||||
if constexpr (std::is_same_v<T, void>)
|
||||
if constexpr (std::is_same_v<T, void>) {
|
||||
return false;
|
||||
|
||||
} else {
|
||||
return QMetaType::registerConverter<QFuture<T>, QFuture<void>>(
|
||||
[](const QFuture<T> &future) { return QFuture<void>(future); });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace QtPrivate
|
||||
|
Loading…
x
Reference in New Issue
Block a user