diff options
author | Samuel Gaist <samuel.gaist@idiap.ch> | 2018-12-09 08:38:57 +0100 |
---|---|---|
committer | Samuel Gaist <samuel.gaist@idiap.ch> | 2018-12-15 13:24:29 +0000 |
commit | a5eabac96de54706de55497b16a46dc2223ac6e9 (patch) | |
tree | 0ff0503cc34cc2c479f9c6e18f258e1fdebd6fe3 /src/tools/moc/moc.cpp | |
parent | 41c1866d3e8d30dfc1e7b29123ff2b834e7489f7 (diff) |
moc: add support for C++11 enum struct
C++11 added the new enum class key as well as enum struct. While the
former is likely the most known and used, the later can be used in the
same contexts and with the same effects.
Currently moc doesn't parse enum struct while it does for enum class.
This patch fixes this.
[ChangeLog][moc] moc now parses enum struct the same way as enum class
therefore that keyword can be used with the Q_ENUM macro as well as
Q_FLAG and Q_DECLARE_FLAGS.
Change-Id: Iaac3814ad63a15ee4d91b281d451e786b510449c
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/tools/moc/moc.cpp')
-rw-r--r-- | src/tools/moc/moc.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index 61a5542c83..7272df4265 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -260,7 +260,7 @@ bool Moc::parseEnum(EnumDef *def) { bool isTypdefEnum = false; // typedef enum { ... } Foo; - if (test(CLASS)) + if (test(CLASS) || test(STRUCT)) def->isEnumClass = true; if (test(IDENTIFIER)) { |