Details
-
Bug
-
Resolution: Fixed
-
P2: Important
-
6.4.3, dev
-
None
-
clang 16, libc++, and -std=c++2b
-
-
003c29511 (dev), 041b8f372 (tqtc/lts-6.2), 9529e3e13 (6.6), 83817bd91 (6.5), 44b7b1d11 (dev), a13d7d659 (6.7), 634e0cd67 (6.6), f8619b9b2 (tqtc/lts-6.5), 1a76d86d8 (tqtc/lts-6.2)
Description
corelib/kernel/qmetacontainer.h and corelib/serialization/qdatastream.h use things like std::distance, std::advance, and std::next without including <iterator>.
This causes compilation failures under clang 16, libc++, and with -std=cxx2b:
In file included from /tmp/qtbase/src/corelib/global/qfloat16.cpp:9: In file included from /tmp/qtb/include/QtCore/qdatastream.h:1: /tmp/qtb/include/QtCore/../../../qtbase/src/corelib/serialization/qdatastream.h:314:34: error: no member named 'distance' in namespace 'std' const qint64 last = std::distance(rangeStart, it) - 1; ~~~~~^ /tmp/qtb/include/QtCore/../../../qtbase/src/corelib/serialization/qdatastream.h:316:30: error: no member named 'next' in namespace 'std' auto next = std::next(rangeStart, i);
Example triggering compilation command line:
/usr/bin/clang++-16 -DHAVE_CONFIG_H -DPCRE2_CODE_UNIT_WIDTH=16 -DPCRE2_DISABLE_JIT -DQT_BOOTSTRAPPED -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_NO_AS_CONST -DQT_NO_CAST_FROM_ASCII -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_FOREACH -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QEXCHANGE -DQT_TYPESAFE_FLAGS -DQT_USE_QSTRINGBUILDER -DQT_VERSION_MAJOR=6 -DQT_VERSION_MINOR=7 -DQT_VERSION_PATCH=0 -DQT_VERSION_STR=\"6.7.0\" -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/tmp/qtb/src/corelib/Core_autogen/include -I/tmp/qtb/include -I/tmp/qtb/include/QtCore -I/tmp/qtbase/src/corelib -I/tmp/qtb/src/corelib -I/tmp/qtb/src/corelib/global -I/tmp/qtb/src/corelib/kernel -I/tmp/qtbase/src/corelib/../3rdparty/tinycbor/src -I/tmp/qtb/include/QtCore/6.7.0 -I/tmp/qtb/include/QtCore/6.7.0/QtCore -I/tmp/qtbase/src/corelib/../3rdparty/double-conversion/double-conversion -I/tmp/qtbase/src/corelib/../3rdparty/double-conversion -I/tmp/qtbase/src/corelib/../3rdparty/forkfd -I/tmp/qtb/src/corelib/.rcc -I/tmp/qtbase/mkspecs/linux-clang -I/tmp/qtbase/src/3rdparty/pcre2/src -I/tmp/qtbase/src/tools/bootstrap/../../corelib/global -I/tmp/qtbase/src/tools/bootstrap/.. -I/tmp/qtbase/src/tools/bootstrap/../../3rdparty/tinycbor/src -I/tmp/qtbase/src/tools/bootstrap/../../3rdparty/pcre2/src -DNDEBUG -O2 -fPIC -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -ffunction-sections -fdata-sections -stdlib=libc++ -std=c++2b -MD -MT src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/global/qfloat16.cpp.o -MF CMakeFiles/Bootstrap.dir/__/__/corelib/global/qfloat16.cpp.o.d -o CMakeFiles/Bootstrap.dir/__/__/corelib/global/qfloat16.cpp.o -c /tmp/qtbase/src/corelib/global/qfloat16.cpp
Attachments
For Gerrit Dashboard: QTBUG-114583 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
485521,3 | QMetaContainer: add missing #include <iterator> | dev | qt/qtbase | Status: MERGED | +2 | 0 |
487863,2 | QMetaContainer: add missing #include <iterator> | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
487901,2 | QMetaContainer: add missing #include <iterator> | 6.5 | qt/qtbase | Status: MERGED | +2 | 0 |
487903,2 | QMetaContainer: add missing #include <iterator> | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
528349,2 | QDataStream: add missing #include <iterator> | dev | qt/qtbase | Status: MERGED | +2 | 0 |
529629,2 | QDataStream: add missing #include <iterator> | 6.7 | qt/qtbase | Status: MERGED | +2 | 0 |
529936,2 | QDataStream: add missing #include <iterator> | 6.6 | qt/qtbase | Status: MERGED | +2 | 0 |
530440,2 | QDataStream: add missing #include <iterator> | tqtc/lts-6.5 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
530447,2 | QDataStream: add missing #include <iterator> | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |