Details
Description
qdbusxml2cpp6, as before its Qt5 sibling, when generating code for a method with
<annotation name="org.freedesktop.DBus.Deprecated" value="true"/>
adds the Q_DECL_DEPRECATED between the inline specifier and the actual method declaration.
Just, with Qt6 Q_DECL_DEPRECATED now gets resolved to the standard attribute [[deprecated] when available, not just the compiler specific _attribute_ ((_deprecated_)).
And as a result the compiler, which has to be strict with the order when it comes to standard attributes, fails over this
<build-dir>/kf6/frameworks/kwallet/src/api/KWallet/kwallet_interface.h:231:12: error: standard attributes in middle of decl-specifiers 231 | inline Q_DECL_DEPRECATED QDBusPendingReply<QVariantMap> readEntryList(int handle, const QString &folder, const QString &key, const QString &appid) | ^~~~~~~~~~~~~~~~~ <build-dir>/kf6/frameworks/kwallet/src/api/KWallet/kwallet_interface.h:231:12: note: standard attributes must precede the decl-specifiers to apply to the declaration, or follow them to apply to the type
So the Q_DECL_DEPRECATED needs to be placed before the inline specifier, at least in that case of standard attributes.
At least with the GCC compiler having the compiler-specific attribute before the inline works as well, so the macro placed there works in both cases. No idea about all the other compilers though.
Attachments
Issue Links
- resulted in
-
QTBUG-111330 error: Not a signal or slot declaration in code generated by qt_add_dbus_interface
- Closed
For Gerrit Dashboard: QTBUG-110979 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
459002,1 | qdbusxml2cpp: invert Q_DECL_DEPRECATED and inline in the output | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: NEW | 0 | 0 |