moc: handle attributes in class declarations
We already had code to handle attributes on funtcions, but we didn't handle them correctly for classes so far. Fix this by simply skipping over the attribute. Fixes: QTBUG-105310 Pick-to: 5.15 6.2 6.3 6.4 Change-Id: Ic4149f940e74820de4f2fa9540d9dc5b4e626a3a Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
parent
d5580aa719
commit
84ab6c1aa1
@ -40,6 +40,9 @@ bool Moc::parseClassHead(ClassDef *def)
|
|||||||
return false;
|
return false;
|
||||||
} while (token);
|
} while (token);
|
||||||
|
|
||||||
|
// support attributes like "class [[deprecated]]] name"
|
||||||
|
skipCxxAttributes();
|
||||||
|
|
||||||
if (!test(IDENTIFIER)) // typedef struct { ... }
|
if (!test(IDENTIFIER)) // typedef struct { ... }
|
||||||
return false;
|
return false;
|
||||||
QByteArray name = lexem();
|
QByteArray name = lexem();
|
||||||
|
@ -10,7 +10,7 @@ QT_WARNING_PUSH
|
|||||||
QT_WARNING_DISABLE_CLANG("-Wunknown-attributes")
|
QT_WARNING_DISABLE_CLANG("-Wunknown-attributes")
|
||||||
QT_WARNING_DISABLE_GCC("-Wattributes")
|
QT_WARNING_DISABLE_GCC("-Wattributes")
|
||||||
|
|
||||||
class CppAttribute : public QObject
|
class [[deprecated]] CppAttribute : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
signals:
|
signals:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user