aboutsummarylogtreecommitdiffstats
path: root/0033-Handle-even-more-include-in-enum-cases.patch
diff options
context:
space:
mode:
authorMartchus2022-04-26 19:38:56 +0200
committerMartchus2022-04-26 19:38:56 +0200
commit6bd8d3a7704d45d2eb9df598c0a326314fa78e8e (patch)
tree026bb60a4c15e2131b26a3be420e24ec18bf947b /0033-Handle-even-more-include-in-enum-cases.patch
parentf08078c53ded4379c2b660f1f653c2e30bdee865 (diff)
downloadaur-6bd8d3a7704d45d2eb9df598c0a326314fa78e8e.tar.gz
Update KDE fork version, cherry-pick 8797332
Diffstat (limited to '0033-Handle-even-more-include-in-enum-cases.patch')
-rw-r--r--0033-Handle-even-more-include-in-enum-cases.patch56
1 files changed, 56 insertions, 0 deletions
diff --git a/0033-Handle-even-more-include-in-enum-cases.patch b/0033-Handle-even-more-include-in-enum-cases.patch
new file mode 100644
index 000000000000..a029a3730f75
--- /dev/null
+++ b/0033-Handle-even-more-include-in-enum-cases.patch
@@ -0,0 +1,56 @@
+From a785d0d6b84ccbe0e74d7846076ba6df7d250dd8 Mon Sep 17 00:00:00 2001
+From: Fabian Kosmale <fabian.kosmale@qt.io>
+Date: Tue, 3 Aug 2021 16:23:25 +0200
+Subject: [PATCH 33/33] 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 <andrei.golubev@qt.io>
+Reviewed-by: Lars Knoll <lars.knoll@qt.io>
+---
+ src/tools/moc/moc.cpp | 3 +--
+ tests/auto/tools/moc/enum_with_include.h | 5 +++++
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/src/tools/moc/moc.cpp b/src/tools/moc/moc.cpp
+index 7389919911..28c7a43cb8 100644
+--- a/src/tools/moc/moc.cpp
++++ b/src/tools/moc/moc.cpp
+@@ -305,10 +305,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();
+diff --git a/tests/auto/tools/moc/enum_with_include.h b/tests/auto/tools/moc/enum_with_include.h
+index b8abf77f12..cd53ba6a28 100644
+--- a/tests/auto/tools/moc/enum_with_include.h
++++ b/tests/auto/tools/moc/enum_with_include.h
+@@ -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
+--
+2.36.0
+