From 8d4807da5cad918a3eedc78f916b74ef4a4b4be3 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Wed, 22 Nov 2023 15:25:55 +0100 Subject: [PATCH] qxp::function_ref: try to work around compilation failure on VxWorks Task-number: QTBUG-115777 Pick-to: 6.5 Change-Id: Icda59c33ae8c92460c7cb06e204c6b1926b82f66 Reviewed-by: Krzysztof Sommerfeld Reviewed-by: Fabian Kosmale Reviewed-by: Qt CI Bot (cherry picked from commit 062718a7d32b683035055e28864729bc097b1d09) Reviewed-by: Qt Cherry-pick Bot --- src/corelib/global/qxpfunctional.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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