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

Inconsistent hashing between bool and integral overloads

    XMLWordPrintable

Details

    • 3
    • 878077de2 (dev), 81adaf909 (dev), 72c3ae0a8 (6.8), 13d2398e0 (6.7), 705cec8ac (tqtc/lts-6.5)
    • Foundation Sprint 110, Foundation Sprint 111, Foundation Sprint 112

    Description

      Besides QTBUG-116080, we also have an unintended implementation of qHash(bool) via the 1-to-2-arg adapter (QTBUG-116971) and qHash(int). The two functions differ in the relative sequence of seed xoring and bit-mixing, making

      • qHash(1, seed),
      • qHash(true, seed)

      produce different values, for general seed != 0.

      This doesn't look fixable in Qt 6, as all involved overloads are inline, therefore immutable.

      Attachments

        Issue Links

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

          Activity

            People

              mmutz Marc Mutz
              mmutz Marc Mutz
              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