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

[Reg 5.15.2->5.15.3/6] QString::lastIndexOf is broken

    XMLWordPrintable

Details

    • 6cee204d56205e250b0675c9c6d4dd8a2367f3c4 (qt/qtbase/dev) 75d699e1cd1cd44f5519ee5bc36e5821b0c9c14c (qt/qtbase/6.2) f90c1a2b54b72a9455cf952ceb0250ffc7e0d648 (qt/qtbase/6.1.3) 8320a92141b736683bb3372f754375cb52836f5d (qt/qtbase/6.1.3)

    Description

      #include <QDebug>
      #include <QRegularExpression>
      #include <QString>
      
      int main(int argc, char *argv[])
      {
          const QRegularExpression expr("\\s+");
          const QString str("Foo Bar Blubb");
          qDebug() << str.lastIndexOf(expr, -7);
      }
      

      prints 7 instead of the correct 3.

      I'd suspect https://codereview.qt-project.org/c/qt/qtbase/+/325907 (though I haven't tried to confirm that).

      Attachments

        Issue Links

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

          Activity

            People

              peppe Giuseppe D'Angelo
              con Eike Ziller
              Votes:
              1 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: