- 
    
Bug
 - 
    Resolution: Unresolved
 - 
    
P1: Critical
 - 
    6.8.3
 - 
    None
 
- 
        
 - 
        7cbfdd1ee (dev), bcf60a442 (6.10), b096619ac (dev), 23df76641 (6.10), 0a735823a (tqtc/lts-6.8), 9d5fadc23 (tqtc/lts-6.8), bc8dee125 (dev), 64c35a03e (dev), ea629a9b5 (6.10), 89ac47143 (6.10), 02be31b04 (tqtc/lts-6.8), 829208d4e (tqtc/lts-6.8)
 
Since https://github.com/llvm/llvm-project/pull/154092, building QtDeclarative 6.8.3 with libc++ fails, with errors like these:
include/c++/v1/__algorithm/sift_down.h:49:46: error: type 'QTaggedIterator<QTaggedIterator<QSequentialIterator, void>, std::random_access_iterator_tag>' does not provide a subscript operator
49 | } else if ((_child + 1) < __len && __comp(_first[__child], __first[__child + 1])) {
The offending code is here: https://code.qt.io/cgit/qt/qtdeclarative.git/tree/src/qml/jsruntime/qv4sequenceobject.cpp?h=v6.8.3#n53
The libc++ developer noted:
> That looks to me like an issue with the iterator. If its iterator_category derives from random_access_iteratorit has to provide a subscript operator according to https://eel.is/c++draft/iterator.requirements#tab:randomaccessiterator. Given that make_heap requires a random access iterator that part is not even optional.
> std::sort also requires random access iterators, so I'm not quite sure why there is a QSequentialIterable::BidirectionalIterator. (I assume that's bidirectional only)
This issue did go away in 6.9, in https://code.qt.io/cgit/qt/qtdeclarative.git/commit/src/qml/jsruntime/qv4sequenceobject.cpp?h=v6.9.0&id=6537b2b23b22d8ac776d1d97f436bb6d9e8e20da (which entirely removed the offending std::sort lines).
However, for Qt 6.8, what's the right approach here to fix the use of std::sort with QSequentialIterable::RandomAccessIterator and QSequentialIterable::BidirectionalIterator here?
| For Gerrit Dashboard: QTBUG-140181 | ||||||
|---|---|---|---|---|---|---|
| # | Subject | Branch | Project | Status | CR | V | 
| 676607,32 | Core: Add operator[] to our meta-iterators | dev | qt/qtbase | Status: NEW | +1 | 0 | 
| 678328,35 | Core: Provide non-broken implementation of QVariant{Ref|Pointer} | dev | qt/qtbase | Status: NEW | +1 | 0 | 
| 678329,42 | Core: Provide non-broken metacontainer iterables | dev | qt/qtbase | Status: NEW | 0 | 0 | 
| 679760,3 | Replace QSequentialIterable with QMetaSequence::Iterable | dev | qt/qtdeclarative | Status: NEW | +2 | 0 | 
| 679762,3 | Replace Q{Sequential|Associative}Iterable with QMeta*::Iterable | dev | qt/qtremoteobjects | Status: NEW | +2 | 0 | 
| 679764,3 | Replace QSequentialIterable with QMetaSequence::Iterable | dev | qt/qt3d | Status: NEW | +2 | 0 | 
| 679924,26 | Core: Deprecate Q{Associative|Sequential}Iterable | dev | qt/qtbase | Status: NEW | +1 | 0 | 
| 681449,1 | Replace QSequentialIterable with QMetaSequence::Iterable | dev | qt/qtwebchannel | Status: NEW | +2 | 0 | 
| 684494,9 | Core: Deprecate QVariant{Ref|ConstPointer|Pointer} | dev | qt/qtbase | Status: NEW | +1 | 0 |