From 87973325f1b99f2b25a5a0224e623803872ce2ef Mon Sep 17 00:00:00 2001 From: Fabian Kosmale Date: Tue, 3 Aug 2021 16:23:25 +0200 Subject: 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 Pick-to: 6.2 6.1 5.15 Change-Id: Ieec4b89e1d117637f11479e8bddc4060f93da43d Reviewed-by: Andrei Golubev Reviewed-by: Lars Knoll --- src/tools/moc/moc.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/tools/moc') diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp index d57e43b59d..56440129c2 100644 --- a/src/tools/moc/moc.cpp +++ b/src/tools/moc/moc.cpp @@ -285,10 +285,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(); -- cgit v1.2.3