diff --git a/src/corelib/global/qxpfunctional.h b/src/corelib/global/qxpfunctional.h index abe00087adb..60508f6315c 100644 --- a/src/corelib/global/qxpfunctional.h +++ b/src/corelib/global/qxpfunctional.h @@ -108,6 +108,23 @@ public: class F, std::enable_if_t, function_ref_base>>, +#ifdef Q_OS_VXWORKS + // The VxWorks compiler is trying to match this ctor against + // qxp::function_ref in lieu of using the copy-constructor, so ban + // matching against the equivalent qxp::function_ref here. + // This doesn't change anything on other platforms, so to save + // on compile-speed, enable it only for VxWorks: + std::negation< + std::is_same< + q20::remove_cvref_t, + std::conditional_t< + std::is_const_v, + qxp::function_ref, + qxp::function_ref + > + > + >, +#endif // Q_OS_VXWORKS std::negation>>, is_invocable_using>&> >, bool> = true