QEvent: add strategic [[maybe_unused]] to Q_IMPL_EVENT_COMMON

Apparently, in unity-builds Q_ASSERT does not always compile its
argument, so I'm getting -Werror,-Wunused-variable on Clang 15.

Fix by adding [[maybe_unused]].

Amends da0f72ebb817bb9c92c7a183b281d8a4bf31a135.

Change-Id: I2de810aded1226ce4e5651de8c2e9464de3f274f
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit f71f0312d66c4e937c7ce13972617c393e96cabb)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Marc Mutz 2023-07-03 18:01:16 +02:00 committed by Qt Cherry-pick Bot
parent 0b1fdf1185
commit 95fa5e33d0

View File

@ -34,7 +34,7 @@ protected: \
Class* Class::clone() const \
{ \
auto c = new Class(*this); \
QEvent *e = c; \
[[maybe_unused]] QEvent *e = c; \
/* check that covariant return is safe to add */ \
Q_ASSERT(reinterpret_cast<quintptr>(c) == reinterpret_cast<quintptr>(e)); \
return c; \