Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-86985

Using QMultiMapIterator to iterate over a QMultiMap asserts

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • P1: Critical
    • None
    • 6.0.0 Alpha
    • None

    Description

      Running the following against today's qtbase:

      #include <QtCore>
      
      int main(int argc, char *argv[])
      {
          QMultiMap<int, int> mm;
      
          mm.insert(0, 0);
          mm.insert(1, 10);
          mm.insert(2, 100);
          mm.insert(2, 200);
          mm.insert(3, 1000);
          mm.insert(3, 2000);
          mm.insert(3, 3000);
      
          QMultiMapIterator it(mm);
          while (it.hasNext()) {
              qDebug() << it.key() << it.value();
              it.next();
          }
      
          return 0;
      }
      

      results in:

      ASSERT: "item_exists()" in file /Users/vohi/qt/dev/qtbase-build/include/QtCore/../../../qtbase/src/corelib/tools/qmap.h, line 1410
      Abort trap: 6
      

      Fully declaring the QMultiMapIterator with template parameter makes no difference.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            peppe Giuseppe D'Angelo
            vhilshei Volker Hilsheimer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes