summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetatype.h
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2022-09-18 16:27:32 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2022-09-22 22:43:37 +0200
commit9b3de58d2dfedfdd8097b329438a2f2f086aa43f (patch)
tree1542776f58b081c2194f0fbc094b3de853758a0b /src/corelib/kernel/qmetatype.h
parentd8387fc538e31d3aef9ae046b327ddf42eca3aa5 (diff)
QMetaType of non-const ref: play nice with template instantiations
...by making QMetaTypeId2 contain all expected members. While we don't allow QMetaType from non-const references, we want to get to the static_assert telling us as much, instead of running into more or less incomprehensible error messages in the depths of qmetatype.h. Pick-to: 6.4 Task-number: QTBUG-106672 Change-Id: Ica9b13fee95eda97cafab2cccdc5249dfc3dcdf2 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/corelib/kernel/qmetatype.h')
-rw-r--r--src/corelib/kernel/qmetatype.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 8e4a2af77b..4092c106d2 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -1204,7 +1204,12 @@ template <typename T>
struct QMetaTypeId2<const T&> : QMetaTypeId2<T> {};
template <typename T>
-struct QMetaTypeId2<T&> { enum {Defined = false }; };
+struct QMetaTypeId2<T&>
+{
+ using NameAsArrayType = void;
+ enum { Defined = false, IsBuiltIn = false };
+ static inline constexpr int qt_metatype_id() { return 0; }
+};
namespace QtPrivate {
template <typename T, bool Defined = QMetaTypeId2<T>::Defined>