summaryrefslogtreecommitdiffstats
path: root/src/dbus/qdbusmetaobject.cpp
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2022-07-15 22:31:56 -0700
committerThiago Macieira <thiago.macieira@intel.com>2022-07-27 14:51:46 -0700
commit2d0c31e7d92a3e9df4ce2b9c1d41b94fb12735fc (patch)
tree5e5ef9228a12d9cc8f7dc2bb8802019147c75088 /src/dbus/qdbusmetaobject.cpp
parent7211771c64caad7880212b1a35d4a6070800c0fa (diff)
QMetaType: fix QMetaTypes for non-const references
Namely, they shouldn't be supported. Even trying to create such a type (as in QMetaType::fromType<int &>()) should fail, because for the purposes of the meta type, they are not the same. However, they were being registered in the meta objects' meta type list as a mistake since commit cb43aaca112c864a201b87037692cb8ae2e93b6d ("Introduce QMetaObject::metaType"), including for output parameters in D-Bus remote objects' meta objects. despite the comment saying "type id not available". [ChangeLog][Potentially Source-incompatible Changes] Made meta types for non-const references fail to compile. Previously, QMetaType::fromType allowed this to compile, but returned the meta type for the base type, which was incorrect. Const references are understood to be the same as the base type. [ChangeLog][Important Behavior Changes] The meta type for non-const reference parameters in extracted methods (signals, slots, etc.) is no longer available in QMetaMethod. This used to be the case in Qt 4.x and 5.x, but due to a mistake in Qt 6.0-6.3, QMetaMethod would incorrectly report the base (non-reference) type. Additionally, both the reference and the non-reference types may have been reported in different APIs. Pick-to: 6.4 Change-Id: I36b24183fbd041179f2ffffd1702384d2b64a5f9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Diffstat (limited to 'src/dbus/qdbusmetaobject.cpp')
-rw-r--r--src/dbus/qdbusmetaobject.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/dbus/qdbusmetaobject.cpp b/src/dbus/qdbusmetaobject.cpp
index 79372484fb..54c9389862 100644
--- a/src/dbus/qdbusmetaobject.cpp
+++ b/src/dbus/qdbusmetaobject.cpp
@@ -477,8 +477,8 @@ void QDBusMetaObjectGenerator::write(QDBusMetaObject *obj)
// Output parameters are references; type id not available
typeName = QMetaType(type).name();
typeName.append('&');
+ type = QMetaType::UnknownType;
}
- Q_ASSERT(type != QMetaType::UnknownType);
int typeInfo;
if (!typeName.isEmpty())
typeInfo = IsUnresolvedType | strings.enter(typeName);