Handle even more include in enum cases
The solution in d3ed7dac8a
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 <andrei.golubev@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
This commit is contained in:
parent
71334c324e
commit
87973325f1
@ -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();
|
||||
|
@ -34,6 +34,11 @@ class Foo : public QObject {
|
||||
enum en {
|
||||
#include <enum_inc.h>
|
||||
};
|
||||
|
||||
enum class en2 {
|
||||
#include <enum_inc.h>
|
||||
reference = 42
|
||||
};
|
||||
Q_OBJECT
|
||||
};
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user