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 ); auto untypedEvaluationFunction = static_cast(f); return std::invoke(*untypedEvaluationFunction, metaType, dataPtr); - } else { + } else if constexpr (!std::is_same_v) { // check for void to woraround MSVC issue Q_UNUSED(metaType); QPropertyData *propertyPtr = static_cast *>(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(f)->~Callable(); },