summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFabian Kosmale <fabian.kosmale@qt.io>2021-08-03 16:23:25 +0200
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2021-08-06 14:18:15 +0000
commitf4375cb9c7c3a74f57df5cf36e54ad7ad98a102f (patch)
tree810c4833d203a40be63eb64789b94a357b59bf39 /src
parent98a3b4f2b561c059cfb9e4798f448100362f41cb (diff)
Handle even more include in enum cases
The solution in d3ed7dac8aa2f4ede0c409254b9dd44842086be0 was needlessly complicated, and broke a valid use case. The issue of no identifier being available to parse after the include has been processed can instead be solved by moving the test for the closing brace after the include processing. Fixes: QTBUG-94790 Change-Id: Ieec4b89e1d117637f11479e8bddc4060f93da43d Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 87973325f1b99f2b25a5a0224e623803872ce2ef) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Diffstat (limited to 'src')
-rw-r--r--src/tools/moc/moc.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
index 057b1c6324..416f803801 100644
--- a/src/tools/moc/moc.cpp
+++ b/src/tools/moc/moc.cpp
@@ -306,10 +306,9 @@ bool Moc::parseEnum(EnumDef *def)
return IncludeState::NoInclude;
};
do {
+ handleInclude();
if (lookup() == RBRACE) // accept trailing comma
break;
- if ( handleInclude() == IncludeState::IncludeEnd)
- continue;
next(IDENTIFIER);
def->values += lexem();
handleInclude();