[neon/qt/qtbase/Neon/release] debian: Backport upstream patch to fix parsing include inside enum.

Dmitry Shachnev null at kde.org
Thu May 5 10:59:26 BST 2022


Git commit 62288f2f3885af20cc6da92d04b82118be034752 by Dmitry Shachnev.
Committed on 07/04/2022 at 10:43.
Pushed by jriddell into branch 'Neon/release'.

Backport upstream patch to fix parsing include inside enum.

LP: #1968074.

M  +3    -0    debian/changelog
A  +37   -0    debian/patches/moc_handle_include.diff
M  +1    -0    debian/patches/series

https://invent.kde.org/neon/qt/qtbase/commit/62288f2f3885af20cc6da92d04b82118be034752

diff --git a/debian/changelog b/debian/changelog
index e9ec1c3..3aa897b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,9 @@ qtbase-opensource-src (5.15.3+dfsg-2) UNRELEASED; urgency=medium
   * Backport upstream patch to fix qtconcurrentthreadengine.h with GCC 11.
     - Closes: #1008391
 
+  [ Dmitry Shachnev ]
+  * Backport upstream patch to fix parsing include inside enum (LP: #1968074).
+
  -- Debian Qt/KDE Maintainers <debian-qt-kde at lists.debian.org>  Sat, 02 Apr 2022 00:58:27 +0200
 
 qtbase-opensource-src (5.15.3+dfsg-1) experimental; urgency=medium
diff --git a/debian/patches/moc_handle_include.diff b/debian/patches/moc_handle_include.diff
new file mode 100644
index 0000000..a337b49
--- /dev/null
+++ b/debian/patches/moc_handle_include.diff
@@ -0,0 +1,37 @@
+Description: 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.
+Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=87973325f1b99f2b
+Last-Update: 2022-04-07
+
+--- 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();
+--- 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
diff --git a/debian/patches/series b/debian/patches/series
index 8a0a3a0..bb8030b 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -14,6 +14,7 @@ CVE-2021-38593.diff
 openssl3.diff
 CVE-2022-25255.diff
 gcc-11-qtconcurrentthreadengine.diff
+moc_handle_include.diff
 
 # Debian specific.
 gnukfreebsd.diff



More information about the Neon-commits mailing list