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

[REG 5.15 -> 6] QList::op==() is broken for FP types

    XMLWordPrintable

Details

    • 3
    • cb3faeba3 (dev), f53074c74 (6.8), a56aba7d1 (6.7), 0a4b037b9 (tqtc/lts-6.5), 6baf85f92 (tqtc/lts-6.2)
    • Foundation Sprint 113

    Description

      FP types are partially ordered, so comparison of containers that store NaN values should take it into consideration.
      However, in practice we see that comparison of two QLists holding NaN values provides different results than simply comparing two NaN values:

      QList<float> l1{std::numeric_limits<float>::quiet_NaN()};
      QList<float> l2{std::numeric_limits<float>::quiet_NaN()};
      qDebug() << (l1 == l2); // true
      qDebug() << (l1.front() == l2.front()); // false
      

      The reason for that is most probably qtbase/db89349bdba2fcc03b2f7e2d23f549a9ec5dc0e3 (https://codereview.qt-project.org/c/qt/qtbase/+/282602) which added an optimization that uses memcmp() for arithmetic types.

      Attachments

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

        Activity

          People

            ivan.solovev Ivan Solovev
            ivan.solovev Ivan Solovev
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes