[LLVMbugs] [Bug 13925] New: Qt's QList iterators and std::distance.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Sep 26 03:58:46 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13925

             Bug #: 13925
           Summary: Qt's QList iterators and std::distance.
           Product: libc++
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
        AssignedTo: hhinnant at apple.com
        ReportedBy: 6yearold at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Compiling this code:

void foo()
{
    QList<char> l;
    QList<char>::iterator i;
    std::distance(l.begin(), i);
}

with "-stdlib=libc++ -std=c++11" flags yields this error:

libc++qlistbug.cpp:8:5: error: no matching function for call to 'distance'
    std::distance(l.begin(), i);
    ^~~~~~~~~~~~~
/usr/include/c++/v1/iterator:480:1: note: candidate template ignored:
substitution failure [with _InputIter = QList<char>::iterator]: no type named
'difference_type' in
      'std::__1::iterator_traits<QList<char>::iterator>'
distance(_InputIter __first, _InputIter __last)
^
1 error generated.

Note: I'm using libc++ from FreeBSD's base distribution, so it may be not up to
date.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list