summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qpropertyprivate.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/kernel/qpropertyprivate.h')
-rw-r--r--src/corelib/kernel/qpropertyprivate.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/corelib/kernel/qpropertyprivate.h b/src/corelib/kernel/qpropertyprivate.h
index f59221c4df..5b6a9557f9 100644
--- a/src/corelib/kernel/qpropertyprivate.h
+++ b/src/corelib/kernel/qpropertyprivate.h
@@ -199,7 +199,7 @@ struct BindingFunctionVTable
static_assert (std::is_invocable_r_v<bool, Callable, QMetaType, QUntypedPropertyData *> );
auto untypedEvaluationFunction = static_cast<Callable *>(f);
return std::invoke(*untypedEvaluationFunction, metaType, dataPtr);
- } else {
+ } else if constexpr (!std::is_same_v<PropertyType, void>) { // check for void to woraround MSVC issue
Q_UNUSED(metaType);
QPropertyData<PropertyType> *propertyPtr = static_cast<QPropertyData<PropertyType> *>(dataPtr);
// That is allowed by POSIX even if Callable is a function pointer
@@ -211,6 +211,10 @@ struct BindingFunctionVTable
}
propertyPtr->setValueBypassingBindings(std::move(newValue));
return true;
+ } else {
+ // Our code will never instantiate this
+ Q_UNREACHABLE();
+ return false;
}
},
/*destroy*/[](void *f){ static_cast<Callable *>(f)->~Callable(); },