Public bug reported:

Qt 6.6.2 contains a bug in the `QFutureInterface` constructor definition
that causes a warning (`template-id-cdtor`) to be emitted by g++ 14.2.
In prior versions of Ubuntu, the packaged g++ does not emit a warning
for the same code.

The warning causes projects that use `-Werror` to fail compilation. As a
workaround, projects may set `-Wno-error=template-id-cdtor`, but this
adds complexity to the build chain and requires special build handling
for Oracular.

A fix was already cherry-picked to Qt 6.6 upstream in March 2024, see

* https://bugreports.qt.io/browse/QTBUG-126989
* https://bugreports.qt.io/browse/QTBUG-123153
* https://codereview.qt-project.org/c/qt/qtbase/+/548058

The problematic code was included in many Qt versions and packages, and
was fixed in other distributions as well, for example
https://bugzilla.redhat.com/show_bug.cgi?id=2280366.

```
$ lsb_release -rd
Description:    Ubuntu 24.10
Release:        24.10
```

```
$ apt-cache policy qt6-base-dev
qt6-base-dev:
  Installed: 6.6.2+dfsg-12
  Candidate: 6.6.2+dfsg-12
  Version table:
 *** 6.6.2+dfsg-12 500
        500 http://us.archive.ubuntu.com/ubuntu oracular/universe amd64 Packages
        100 /var/lib/dpkg/status
```

Expected to happen:
When compiling https://github.com/kiwix/kiwix-desktop, the compile should 
succeed with `-Werror` set.

Actually happened:
Compile of kiwix-desktop fails when `-Werror` is set:

```
g++ -c -pipe -std=c++17 -Werror -I/usr/local/include 
-I/usr/include/x86_64-linux-gnu -I/usr/include/p11-kit-1 -O2 -Wall -Wextra 
-D_REENTRANT -DVERSION=2.4.0 -DQT_DEPRECAT
ED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x060000 -DQT_NO_DEBUG 
-DQT_WEBENGINEWIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB 
-DQT_WEBENGINECORE_LIB -DQT_QUICK_LIB -
DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_WEBCHANNEL_LIB -DQT_QML_LIB 
-DQT_NETWORK_LIB -DQT_QMLINTEGRATION_LIB -DQT_POSITIONING_LIB -DQT_CORE_LIB -I. 
-Isubproje
cts/QtSingleApplication/src -I/usr/include/x86_64-linux-gnu/qt6 
-I/usr/include/x86_64-linux-gnu/qt6/QtWebEngineWidgets 
-I/usr/include/x86_64-linux-gnu/qt6/QtPrintSupport
-I/usr/include/x86_64-linux-gnu/qt6/QtWidgets 
-I/usr/include/x86_64-linux-gnu/qt6/QtWebEngineCore 
-I/usr/include/x86_64-linux-gnu/qt6/QtQuick -I/usr/include/x86_64-linux-
gnu/qt6/QtOpenGL -I/usr/include/x86_64-linux-gnu/qt6/QtGui 
-I/usr/include/x86_64-linux-gnu/qt6/QtQmlModels 
-I/usr/include/x86_64-linux-gnu/qt6/QtWebChannel -I/usr/include
/x86_64-linux-gnu/qt6/QtQml -I/usr/include/x86_64-linux-gnu/qt6/QtNetwork 
-I/usr/include/x86_64-linux-gnu/qt6/QtQmlIntegration 
-I/usr/include/x86_64-linux-gnu/qt6/QtPosit
ioning -I/usr/include/x86_64-linux-gnu/qt6/QtCore -I. -I. 
-I/usr/lib/x86_64-linux-gnu/qt6/mkspecs/linux-g++ -o choiceitem.o 
src/choiceitem.cpp
In file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/qfuture.h:9,
                 from /usr/include/x86_64-linux-gnu/qt6/QtCore/QtCore:106,
                 from 
/usr/include/x86_64-linux-gnu/qt6/QtNetwork/QtNetworkDepends:3,
                 from /usr/include/x86_64-linux-gnu/qt6/QtNetwork/QtNetwork:3,
                 from src/opdsrequestmanager.h:5,
                 from src/contentmanager.h:7,
                 from src/kiwixapp.h:5,
                 from src/choiceitem.cpp:5:
/usr/include/x86_64-linux-gnu/qt6/QtCore/qfutureinterface.h:472:37: error: 
template-id not allowed for constructor in C++20 [-Werror=template-id-cdtor]
  472 |     explicit QFutureInterface<void>(State initialState = NoState)
      |                                     ^~~~~
/usr/include/x86_64-linux-gnu/qt6/QtCore/qfutureinterface.h:472:37: note: 
remove the ‘< >’
cc1plus: all warnings being treated as errors
```

Removing `<void>` in the constructor at qfutureinterface.h:472 resolves
the problem.

** Affects: qt6-base (Ubuntu)
     Importance: Undecided
         Status: New

** Description changed:

  Qt 6.6.2 contains a bug in the `QFutureInterface` constructor definition
  that causes a warning (`template-id-cdtor`) to be emitted by g++ 14.2.
  In prior versions of Ubuntu, the packaged g++ does not emit a warning
  for the same code.
  
  The warning causes projects that use `-Werror` to fail compilation. As a
  workaround, projects may set `-Wno-error=template-id-cdtor`, but this
  adds complexity to the build chain and requires special build handling
  for Oracular.
  
- The problem was already cherry-picked to Qt 6.6 upstream in March 2024,
- see
+ A fix was already cherry-picked to Qt 6.6 upstream in March 2024, see
  
  * https://bugreports.qt.io/browse/QTBUG-126989
  * https://bugreports.qt.io/browse/QTBUG-123153
  * https://codereview.qt-project.org/c/qt/qtbase/+/548058
  
  The problematic code was included in many Qt versions and packages, and
  was fixed in other distributions as well, for example
  https://bugzilla.redhat.com/show_bug.cgi?id=2280366.
  
  ```
  $ lsb_release -rd
  Description:    Ubuntu 24.10
  Release:        24.10
  ```
  
  ```
  $ apt-cache policy qt6-base-dev
  qt6-base-dev:
-   Installed: 6.6.2+dfsg-12
-   Candidate: 6.6.2+dfsg-12
-   Version table:
-  *** 6.6.2+dfsg-12 500
-         500 http://us.archive.ubuntu.com/ubuntu oracular/universe amd64 
Packages
-         100 /var/lib/dpkg/status
+   Installed: 6.6.2+dfsg-12
+   Candidate: 6.6.2+dfsg-12
+   Version table:
+  *** 6.6.2+dfsg-12 500
+         500 http://us.archive.ubuntu.com/ubuntu oracular/universe amd64 
Packages
+         100 /var/lib/dpkg/status
  ```
  
  Expected to happen:
  When compiling https://github.com/kiwix/kiwix-desktop, the compile should 
succeed with `-Werror` set.
  
  Actually happened:
  Compile of kiwix-desktop fails when `-Werror` is set:
  
  ```
  g++ -c -pipe -std=c++17 -Werror -I/usr/local/include 
-I/usr/include/x86_64-linux-gnu -I/usr/include/p11-kit-1 -O2 -Wall -Wextra 
-D_REENTRANT -DVERSION=2.4.0 -DQT_DEPRECAT
  ED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x060000 -DQT_NO_DEBUG 
-DQT_WEBENGINEWIDGETS_LIB -DQT_PRINTSUPPORT_LIB -DQT_WIDGETS_LIB 
-DQT_WEBENGINECORE_LIB -DQT_QUICK_LIB -
  DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_QMLMODELS_LIB -DQT_WEBCHANNEL_LIB 
-DQT_QML_LIB -DQT_NETWORK_LIB -DQT_QMLINTEGRATION_LIB -DQT_POSITIONING_LIB 
-DQT_CORE_LIB -I. -Isubproje
  cts/QtSingleApplication/src -I/usr/include/x86_64-linux-gnu/qt6 
-I/usr/include/x86_64-linux-gnu/qt6/QtWebEngineWidgets 
-I/usr/include/x86_64-linux-gnu/qt6/QtPrintSupport
  -I/usr/include/x86_64-linux-gnu/qt6/QtWidgets 
-I/usr/include/x86_64-linux-gnu/qt6/QtWebEngineCore 
-I/usr/include/x86_64-linux-gnu/qt6/QtQuick -I/usr/include/x86_64-linux-
  gnu/qt6/QtOpenGL -I/usr/include/x86_64-linux-gnu/qt6/QtGui 
-I/usr/include/x86_64-linux-gnu/qt6/QtQmlModels 
-I/usr/include/x86_64-linux-gnu/qt6/QtWebChannel -I/usr/include
  /x86_64-linux-gnu/qt6/QtQml -I/usr/include/x86_64-linux-gnu/qt6/QtNetwork 
-I/usr/include/x86_64-linux-gnu/qt6/QtQmlIntegration 
-I/usr/include/x86_64-linux-gnu/qt6/QtPosit
  ioning -I/usr/include/x86_64-linux-gnu/qt6/QtCore -I. -I. 
-I/usr/lib/x86_64-linux-gnu/qt6/mkspecs/linux-g++ -o choiceitem.o 
src/choiceitem.cpp
  In file included from /usr/include/x86_64-linux-gnu/qt6/QtCore/qfuture.h:9,
-                  from /usr/include/x86_64-linux-gnu/qt6/QtCore/QtCore:106,
-                  from 
/usr/include/x86_64-linux-gnu/qt6/QtNetwork/QtNetworkDepends:3,
-                  from /usr/include/x86_64-linux-gnu/qt6/QtNetwork/QtNetwork:3,
-                  from src/opdsrequestmanager.h:5,
-                  from src/contentmanager.h:7,
-                  from src/kiwixapp.h:5,
-                  from src/choiceitem.cpp:5:
+                  from /usr/include/x86_64-linux-gnu/qt6/QtCore/QtCore:106,
+                  from 
/usr/include/x86_64-linux-gnu/qt6/QtNetwork/QtNetworkDepends:3,
+                  from /usr/include/x86_64-linux-gnu/qt6/QtNetwork/QtNetwork:3,
+                  from src/opdsrequestmanager.h:5,
+                  from src/contentmanager.h:7,
+                  from src/kiwixapp.h:5,
+                  from src/choiceitem.cpp:5:
  /usr/include/x86_64-linux-gnu/qt6/QtCore/qfutureinterface.h:472:37: error: 
template-id not allowed for constructor in C++20 [-Werror=template-id-cdtor]
-   472 |     explicit QFutureInterface<void>(State initialState = NoState)
-       |                                     ^~~~~
+   472 |     explicit QFutureInterface<void>(State initialState = NoState)
+       |                                     ^~~~~
  /usr/include/x86_64-linux-gnu/qt6/QtCore/qfutureinterface.h:472:37: note: 
remove the ‘< >’
  cc1plus: all warnings being treated as errors
  ```
  
- 
- Removing `<void>` in the constructor at qfutureinterface.h:472 resolves the 
problem.
+ Removing `<void>` in the constructor at qfutureinterface.h:472 resolves
+ the problem.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2092147

Title:
  QFutureInterface produces warning on g++ 14.2

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/qt6-base/+bug/2092147/+subscriptions


-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to