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

T* and const T* hash to different values

    XMLWordPrintable

Details

    Description

      It turns out the one-arg-to-two-arg adapter strikes again, and causes pointers-to-mutable to hash differently from pointers-to-const.

      There does not appear to be anything we can do about this until Qt 7, as we'd need to either change T* or const T* hashing. Both functions being inline, that means this change would be BiC, whatever we do.

      The fix is otherwise simple: remove the adapter (and move from qHash function templates to qHash class templates, like the std does with std::hash).

      TODO: check whether recent changes to the adapter function template may have caused this in the first place.

      Attachments

        For Gerrit Dashboard: QTBUG-116986
        # Subject Branch Project Status CR V

        Activity

          People

            thiago Thiago Macieira
            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:

              Gerrit Reviews

                There is 1 open Gerrit change