-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
moc: handle nested structs with meta content
We already disallow them for classes; this was a mistake in not handling the "struct" keyword. The C++ syntax is valid, but moc is unable to parse two classes at the same time. Users can define the inner outside of the body of the outer class and that works. [ChangeLog][moc] Fixed a bug that caused moc to attempt to parse a nested struct (not class) with meta keywords and this produced code that wouldn't compile. Nested classes and structures are permitted, but must be defined outside of the declaration of the outer class. The fix for this revealed a bug in the presence of Q_DECLARE_FLAGS for inner classes. This can be easily fixed by moving the token for Q_DECLARE_FLAGS value outside of the [Q_META_TOKEN_BEGIN, Q_META_TOKEN_END] range. [ChangeLog][moc] Fixed a bug that caused moc to reject a class (not struct) containing Q_DECLARE_FLAGS that was defined inside the body of an outer class containing Q_OBJECT or Q_GADGET. Fixes: QTBUG-130498 Pick-to: 6.8 6.5 Change-Id: I2a3f148f70280e87302afffd3e7617e5861bb338 Reviewed-by: Fabian Kosmale <[email protected]>
- Loading branch information
1 parent
cf8b9c1
commit 4e4eef1
Showing
3 changed files
with
39 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters