summaryrefslogtreecommitdiffstats
path: root/src/tools/moc
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2022-08-03 09:16:27 +0200
committerFabian Kosmale <fabian.kosmale@qt.io>2022-08-03 20:14:42 +0200
commit84ab6c1aa1fe4051edb9f96714f0f691d639b725 (patch)
treec08374c3e2902b90e68870db7fba9d966f152497 /src/tools/moc
parentd5580aa7194b84306da52efb189cf126dbaee1f7 (diff)
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>
Diffstat (limited to 'src/tools/moc')
-rw-r--r--src/tools/moc/moc.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 8a5abd3020..5e2ba18a00 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -40,6 +40,9 @@ bool Moc::parseClassHead(ClassDef *def)
return false;
} while (token);
+ // support attributes like "class [[deprecated]]] name"
+ skipCxxAttributes();
+
if (!test(IDENTIFIER)) // typedef struct { ... }
return false;
QByteArray name = lexem();