tst_moc: fix -Wvolatile

Suppress the warning. Found that moc doesn't like QT_WARNING macros in
Q_SIGNALS section and filed QTBUG-126395 to track the issue.

Amends the start of the public history, but not picking back far,
since older GCC could reject the suppression, and it's such a
long-standing issue that fixing it in LTS branches is not worth the
risk of breaking compilation.

Task-number: QTBUG-119042
Task-number: QTBUG-126395
Change-Id: I15ba9ed3b83cce0f4c2a1536317e5167d56f3a57
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
(cherry picked from commit 4111059b2ee3818ab68033198fb1dd057e6d09eb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2024-06-17 07:26:51 +02:00 committed by Qt Cherry-pick Bot
parent d9f7efba82
commit 9d89e28f1c

View File

@ -878,7 +878,14 @@ signals:
void sigWithUnsignedArg(unsigned foo);
void sigWithSignedArg(signed foo);
void sigWithConstSignedArg(const signed foo);
#ifndef Q_MOC_RUN // QTBUG-126395
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wvolatile")
#endif
void sigWithVolatileConstSignedArg(volatile const signed foo);
#ifndef Q_MOC_RUN // QTBUG-126395
QT_WARNING_POP
#endif
void sigWithCustomType(const MyStruct);
void constSignal1() const;
void constSignal2(int arg) const;
@ -4710,4 +4717,7 @@ QTEST_MAIN(tst_Moc)
#undef slots
#undef emit
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wvolatile") // should moc itself add this in generated code?
#include "tst_moc.moc"
QT_WARNING_POP