QProperty: Mark metaType as unused in else branch of createFor()

The metaType is only used in the constexpr if branch where the callable
is not std::is_invocable_v. Therefore, we need to mark it as unused in
order to avoid compile errors in code that exercises the other branch.

Change-Id: I46e855b0f4b0a088f15ff41d4929fe010531b97e
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
This commit is contained in:
Ulf Hermann 2020-11-06 11:00:28 +01:00
parent a6903f3da8
commit b8069f0a47

View File

@ -177,6 +177,7 @@ struct BindingFunctionVTable
auto untypedEvaluationFunction = static_cast<Callable *>(f);
return std::invoke(*untypedEvaluationFunction, metaType, dataPtr);
} else {
Q_UNUSED(metaType);
QPropertyData<PropertyType> *propertyPtr = static_cast<QPropertyData<PropertyType> *>(dataPtr);
// That is allowed by POSIX even if Callable is a function pointer
auto evaluationFunction = static_cast<Callable *>(f);