Bug 481877 - Messagelib fails to compile against Qt 6.7
Summary: Messagelib fails to compile against Qt 6.7
Status: RESOLVED FIXED
Alias: None
Product: kdepim
Classification: Applications
Component: general (show other bugs)
Version: GIT (master)
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-27 02:17 UTC by bluescreenavenger
Modified: 2024-02-27 13:22 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description bluescreenavenger 2024-02-27 02:17:32 UTC
I think Qt 6.7 must have dropped a function recently, using the 6.7 branch, and compiling messagelib, I get the below error

```
[ 11%] Building CXX object messagecore/src/CMakeFiles/KPim6MessageCore.dir/autocrypt_debug.cpp.o
In file included from /opt/include/qt6/QtCore/qbytearray.h:11,
                 from /opt/include/qt6/QtCore/qstringview.h:8,
                 from /opt/include/qt6/QtCore/qchar.h:656,
                 from /opt/include/qt6/QtCore/qtextstream.h:8,
                 from /opt/include/qt6/QtCore/qdebug.h:13,
                 from /opt/include/qt6/QtCore/QDebug:1,
                 from /var/cache/srcbuild/messagelib/webengineviewer/src/urlinterceptor/blocktrackingurlinterceptor/blocktrackingurlinterceptor.h:10,
                 from /var/cache/srcbuild/messagelib/webengineviewer/src/urlinterceptor/blocktrackingurlinterceptor/blocktrackingurlinterceptor.cpp:7:
/opt/include/qt6/QtCore/qarraydatapointer.h: In instantiation of ‘void QArrayDataPointer<T>::assign(InputIterator, InputIterator, Projection) [with InputIterator = const WebEngineViewer::BlockTrackingUrlInterceptor::TrackerBlackList*; Projection = q20::identity; T = WebEngineViewer::BlockTrackingUrlInterceptor::TrackerBlackList]’:
/opt/include/qt6/QtCore/qlist.h:510:15:   required from ‘QList<T>& QList<T>::assign(InputIterator, InputIterator) [with InputIterator = const WebEngineViewer::BlockTrackingUrlInterceptor::TrackerBlackList*; typename std::enable_if<std::is_convertible<typename std::iterator_traits<_InputIterator>::iterator_category, std::input_iterator_tag>::value, bool>::type <anonymous> = true; T = WebEngineViewer::BlockTrackingUrlInterceptor::TrackerBlackList]’
/opt/include/qt6/QtCore/qlist.h:513:20:   required from ‘QList<T>& QList<T>::assign(std::initializer_list<_Tp>) [with T = WebEngineViewer::BlockTrackingUrlInterceptor::TrackerBlackList]’
/opt/include/qt6/QtCore/qlist.h:298:22:   required from ‘QList<T>& QList<T>::operator=(std::initializer_list<_Tp>) [with T = WebEngineViewer::BlockTrackingUrlInterceptor::TrackerBlackList]’
/var/cache/srcbuild/messagelib/webengineviewer/src/urlinterceptor/blocktrackingurlinterceptor/blocktrackingurlinterceptor.cpp:66:119:   required from here
/opt/include/qt6/QtCore/qarraydatapointer.h:408:18: error: use of deleted function ‘WebEngineViewer::BlockTrackingUrlInterceptor::TrackerBlackList& WebEngineViewer::BlockTrackingUrlInterceptor::TrackerBlackList::operator=(const WebEngineViewer::BlockTrackingUrlInterceptor::TrackerBlackList&)’
  408 |             *dst = std::invoke(proj, *first);    // overwrite existing element
      |             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/var/cache/srcbuild/messagelib/webengineviewer/src/urlinterceptor/blocktrackingurlinterceptor/blocktrackingurlinterceptor.h:23:12: note: ‘WebEngineViewer::BlockTrackingUrlInterceptor::TrackerBlackList& WebEngineViewer::BlockTrackingUrlInterceptor::TrackerBlackList::operator=(const WebEngineViewer::BlockTrackingUrlInterceptor::TrackerBlackList&)’ is implicitly deleted because the default definition would be ill-formed:
   23 |     struct TrackerBlackList {
      |            ^~~~~~~~~~~~~~~~
/var/cache/srcbuild/messagelib/webengineviewer/src/urlinterceptor/blocktrackingurlinterceptor/blocktrackingurlinterceptor.h:23:12: error: passing ‘const QString’ as ‘this’ argument discards qualifiers [-fpermissive]
In file included from /opt/include/qt6/QtCore/qdebug.h:15:
/opt/include/qt6/QtCore/qstring.h:178:14: note:   in call to ‘QString& QString::operator=(const QString&)’
  178 |     QString &operator=(const QString &) noexcept;
      |              ^~~~~~~~
/var/cache/srcbuild/messagelib/webengineviewer/src/urlinterceptor/blocktrackingurlinterceptor/blocktrackingurlinterceptor.h:23:12: error: passing ‘const QString’ as ‘this’ argument discards qualifiers [-fpermissive]
   23 |     struct TrackerBlackList {
      |            ^~~~~~~~~~~~~~~~
/opt/include/qt6/QtCore/qstring.h:178:14: note:   in call to ‘QString& QString::operator=(const QString&)’
  178 |     QString &operator=(const QString &) noexcept;
      |              ^~~~~~~~
/var/cache/srcbuild/messagelib/webengineviewer/src/urlinterceptor/blocktrackingurlinterceptor/blocktrackingurlinterceptor.h:23:12: error: passing ‘const QString’ as ‘this’ argument discards qualifiers [-fpermissive]
   23 |     struct TrackerBlackList {
      |            ^~~~~~~~~~~~~~~~
/opt/include/qt6/QtCore/qstring.h:178:14: note:   in call to ‘QString& QString::operator=(const QString&)’
  178 |     QString &operator=(const QString &) noexcept;
      |              ^~~~~~~~
make[2]: *** [webengineviewer/src/CMakeFiles/KPim6WebEngineViewer.dir/build.make:502: webengineviewer/src/CMakeFiles/KPim6WebEngineViewer.dir/urlinterceptor/blocktrackingurlinterceptor/blocktrackingurlinterceptor.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:16021: webengineviewer/src/CMakeFiles/KPim6WebEngineViewer.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 11%] Linking CXX shared library ../../bin/libKPim6MessageCore.so
[ 11%] Built target KPim6MessageCore
make: *** [Makefile:146: all] Error 2
PackageInstallSource finished in 2 seconds with result 2
```
Comment 1 Bug Janitor Service 2024-02-27 13:11:20 UTC
A possibly relevant merge request was started @ https://invent.kde.org/pim/messagelib/-/merge_requests/189
Comment 2 Nicolas Fella 2024-02-27 13:22:23 UTC
Git commit d35252584f7b95c413e59b6e85c1147b29fc8ced by Nicolas Fella.
Committed on 27/02/2024 at 13:10.
Pushed by carlschwan into branch 'master'.

Don't make member variables const

It breaks list initialization with Qt 6.7

M  +3    -3    webengineviewer/src/urlinterceptor/blocktrackingurlinterceptor/blocktrackingurlinterceptor.h

https://invent.kde.org/pim/messagelib/-/commit/d35252584f7b95c413e59b6e85c1147b29fc8ced