[Development] QTBUG-111330: moc help needed: parsing QtDBus Q_NOREPLY

Ilya Fedin fedin-ilja2010 at ya.ru
Mon Mar 13 17:28:58 CET 2023


On Mon, 13 Mar 2023 08:38:54 -0700
Thiago Macieira <thiago.macieira at intel.com> wrote:

> This is a P1 blocker for 6.5.0.
> 
> TL;DR: This is a regression; I broke parsing of previously working
> code and don't know how to fix it.
> 
> The Q_NOREPLY marker is emitted by qdbusxml2cpp to use a little known
> moc feature of extracting "tags" from meta-method declarations and
> having them available in the QMetaMethod::tag(). This has been in use
> in QtDBus since 4.2 in 2006, and it's a feature that predated QtDBus.
> I just made use of it then.
> 
> The feature was designed based on where GCC put the __attribute__
> markers and MSVC put the __declspec markers back in the day. It's NOT
> where C++11 decided to put the [[attribute]] markers. So when
> Q_DECL_DEPRECATED is [[deprecated]], the emitted marker was in the
> wrong position. Commit f67b32e735cbbed6848b5d40a61329f71f54a14d
> fixed that by moving the Q_DECL_DEPRECATED to the right position,
> which is the left. I also moved Q_NOREPLY.
> 
> That broke moc and the task was created:
> "error: Not a signal or slot declaration"
> 
> So I partially reverted in 5d563135e8b32d8cd2508bcfac36561b469c3c6c
> because I didn't know how to fix moc. Now moc no longer emits that
> error, but produces nonsensical code according to the reporter.
> 
>          QtPrivate::TypeAndForceComplete<Q_NOREPLY, std::false_type>,
> 
> Since I've already moved Q_NOREPLY to where it was, I don't know
> what's wrong.
> 

But your original change hasn't moved Q_NOREPLY, it added inline to it
and QDBusPendingReply


More information about the Development mailing list