From e47a83590cb7d397da839dba8f297733d454e9d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sun, 14 May 2023 20:31:16 +0200 Subject: [PATCH] Add Patch to replace std::result_of with decltype to allow building witg C++20 --- .../qt5-base/patches/replace_result_of.patch | 27 +++++++++++++++++++ overlay/osx/qt5-base/portfile.cmake | 1 + 2 files changed, 28 insertions(+) create mode 100644 overlay/osx/qt5-base/patches/replace_result_of.patch diff --git a/overlay/osx/qt5-base/patches/replace_result_of.patch b/overlay/osx/qt5-base/patches/replace_result_of.patch new file mode 100644 index 00000000000000..11c1e91f64b4c2 --- /dev/null +++ b/overlay/osx/qt5-base/patches/replace_result_of.patch @@ -0,0 +1,27 @@ +From fb6acf08bbd7a68d027282251747620b942bd1d6 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?M=C3=A5rten=20Nordheim?= +Date: Tue, 18 Feb 2020 10:13:22 +0100 +Subject: [PATCH] Replace usage of std::result_of with decltype + +It's slated for removal in c++20 + +Fixes: QTBUG-82240 +Change-Id: I7b35c151413b131ca49b2c09b6382efc3fc8ccb6 +Reviewed-by: Timur Pocheptsov +--- + src/corelib/kernel/qobjectdefs.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/corelib/kernel/qobjectdefs.h b/src/corelib/kernel/qobjectdefs.h +index dc2d832fe5b..becbb90a61a 100644 +--- a/src/corelib/kernel/qobjectdefs.h ++++ b/src/corelib/kernel/qobjectdefs.h +@@ -532,7 +532,7 @@ struct Q_CORE_EXPORT QMetaObject + static typename std::enable_if::IsPointerToMemberFunction + && QtPrivate::FunctionPointer::ArgumentCount == -1 + && !std::is_convertible::value, bool>::type +- invokeMethod(QObject *context, Func function, typename std::result_of::type *ret) ++ invokeMethod(QObject *context, Func function, decltype(function()) *ret) + { + return invokeMethodImpl(context, + new QtPrivate::QFunctorSlotObjectWithNoArgs(std::move(function)), diff --git a/overlay/osx/qt5-base/portfile.cmake b/overlay/osx/qt5-base/portfile.cmake index 9ce96f310329b4..28b03ca8000149 100644 --- a/overlay/osx/qt5-base/portfile.cmake +++ b/overlay/osx/qt5-base/portfile.cmake @@ -37,6 +37,7 @@ qt_download_submodule( OUT_SOURCE_PATH SOURCE_PATH patches/arm64_qiosurfacegraphicsbuffer.patch # allow to build on arm64 patches/arm64_qcocoahelper.patch # alow to build on arm64 patches/arm64_send_super_stret.patch # don't use qt_msgSendSuper_stret on arm64 + patches/replace_result_of.patch # Replace usage of std::result_of with decltype ) # Remove vendored dependencies to ensure they are not picked up by the build