2022-07-02 06:48:36 +08:00
|
|
|
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
|
|
|
|
index e40cd85..ba68a01 100644
|
|
|
|
--- a/src/corelib/kernel/qmetatype.h
|
|
|
|
+++ b/src/corelib/kernel/qmetatype.h
|
2022-11-19 04:31:51 +08:00
|
|
|
@@ -18,6 +18,7 @@
|
2023-04-27 03:10:56 +08:00
|
|
|
#include <QtCore/qscopeguard.h>
|
2024-11-23 06:05:29 +08:00
|
|
|
#include <QtCore/qttypetraits.h>
|
2022-07-02 06:48:36 +08:00
|
|
|
|
|
|
|
+#include <type_traits>
|
|
|
|
#include <array>
|
|
|
|
#include <new>
|
|
|
|
#include <vector>
|
|
|
|
@@ -826,7 +829,13 @@
|
|
|
|
struct IsGadgetHelper { enum { IsRealGadget = false, IsGadgetOrDerivedFrom = false }; };
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
+#if defined(__clang__) && (__clang_major__ > 11)
|
|
|
|
+ // Clang does not reject T::QtGadgetHelper as ambiguous if a class inherits from two QGADGETS
|
|
|
|
+ // but is not a QGADGET itself
|
|
|
|
+ struct IsGadgetHelper<T, std::void_t<typename T::QtGadgetHelper, decltype(&T::qt_check_for_QGADGET_macro)>>
|
|
|
|
+#else
|
|
|
|
struct IsGadgetHelper<T, typename T::QtGadgetHelper>
|
|
|
|
+#endif
|
|
|
|
{
|
|
|
|
template <typename X>
|
|
|
|
static char checkType(void (X::*)());
|
|
|
|
@@ -841,7 +850,11 @@
|
|
|
|
struct IsPointerToGadgetHelper { enum { IsRealGadget = false, IsGadgetOrDerivedFrom = false }; };
|
|
|
|
|
|
|
|
template<typename T>
|
|
|
|
+#if defined(__clang__) && (__clang_major__ > 11)
|
|
|
|
+ struct IsPointerToGadgetHelper<T*, std::void_t<typename T::QtGadgetHelper, decltype(&T::qt_check_for_QGADGET_macro)>>
|
|
|
|
+#else
|
|
|
|
struct IsPointerToGadgetHelper<T*, typename T::QtGadgetHelper>
|
|
|
|
+#endif
|
|
|
|
{
|
|
|
|
using BaseType = T;
|
|
|
|
template <typename X>
|