Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.12.2, 5.13
-
None
-
-
ef05c48898e90e4ff40d8c4493f4b80bc22c1703
Description
The following code issues a warning when compiled with GCC 9:
$ cat test.C #include <QList> int main(int argc, char** argv) { QList<int> a; a.append(1); a.removeFirst(); return 0; } $ g++ -std=c++11 -Werror -Wextra -fPIC -I/usr/include/qt -I/usr/include/qt/QtCore -lQt5Core -o test test.C In file included from /usr/include/qt/QtCore/QList:1, from test.C:1: /usr/include/qt/QtCore/qlist.h: In instantiation of ‘QList<T>::iterator QList<T>::erase(QList<T>::iterator) [with T = int]’: /usr/include/qt/QtCore/qlist.h:353:55: required from ‘void QList<T>::removeFirst() [with T = int]’ test.C:7:17: required from here /usr/include/qt/QtCore/qlist.h:536:12: error: implicitly-declared ‘QList<int>::iterator& QList<int>::iterator::operator=(const QList<int>::iterator&)’ is deprecated [-Werror=deprecated-copy] 536 | it = begin(); // implies detach() /usr/include/qt/QtCore/qlist.h:239:16: note: because ‘QList<int>::iterator’ has user-provided ‘QList<T>::iterator::iterator(const QList<T>::iterator&) [with T = int]’ 239 | inline iterator(const iterator &o) Q_DECL_NOTHROW : i(o.i){} | ^~~~~~~~ cc1plus: all warnings being treated as errors
Attachments
For Gerrit Dashboard: QTBUG-75210 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
272258,2 | Fix -Wdeprecated-copy warnings | 5.12 | qt/qtbase | Status: ABANDONED | +2 | 0 |