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

qHash of QHash fails to compile on gcc

    XMLWordPrintable

Details

    • Linux/X11

    Description

      The qHash of QHash table doesn't compile on linux under gcc (version 10 or any modern)

      e.g.: for QHash<int, int> a;

      qHash(a) fails to compile.

      The problem is following:

      In qhash.h (line 1445) the hash commutative combiner is called with std :: pair<const Key&, const T&>. In example above it's std :: pair<const int&, const int&>.

      In qhashfunctions.h (line 139 - 140) QHashCombineCommutative::operator() calls qHash with the std :: pair<const Key&, const T&>. However qHash for std :: pair is defined AFTER on line 167.
      So that it conforms to C++ standard this must be defined (or at least declared) BEFORE.
      Fix is to move this above QHashCombineCommutative.

       

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            filousov Pavel Celba
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes