D24914: Fix build with Qt 5.14

Alexey Min <noreply-Buy57tU0AsCGxO/ty/[email protected]>
Newsgroups gmane.comp.kde.devel.kdevelop
Message-ID <[email protected]>
alexeymin created this revision.
Herald added a project: KDevelop.
Herald added a subscriber: kdevelop-devel.
alexeymin requested review of this revision.

REVISION SUMMARY
  Trying to build kdevelop-pg-qt with Qt 5.14 results in an error:
  
    .../kdev-pg/kdev-pg-regexp.cpp:44:23: error: redefinition of ‘struct std::hash<QBitArray>’
         template<> struct hash< type >                          \
                           ^~~~~~~~~~~~
    .../kdev-pg/kdev-pg-regexp.cpp:53:1: note: in expansion of macro ‘q_Hash_to_tr1_hash’
     q_Hash_to_tr1_hash(QBitArray)
     ^~~~~~~~~~~~~~~~~~
    In file included from .../prefix514/include/QtCore/qvector.h:47:0,
                     from .../prefix514/include/QtCore/QVector:1,
                     from .../kdevelop-pg-qt/include/kdev-pg-char-sets.h:36,
                     from .../kdevelop-pg-qt/kdev-pg/kdev-pg-regexp.cpp:20:
    .../prefix514/include/QtCore/qhashfunctions.h:209:1: note: previous definition of ‘struct std::hash<QBitArray>’
     QT_SPECIALIZE_STD_HASH_TO_CALL_QHASH_BY_CREF(QBitArray)
     ^
  
  std::hash<QBitArray> is already specialized in Qt 5.14, so avoid redefinition with conditional compilation

TEST PLAN
  try to build with Qt 5.14

REPOSITORY
  R51 KDevelop: PG Qt

BRANCH
  fix-build-qt514

REVISION DETAIL
  https://phabricator.kde.org/D24914

AFFECTED FILES
  kdev-pg/kdev-pg-regexp.cpp

To: alexeymin
Cc: kdevelop-devel, hmitonneau, christiant, glebaccon, domson, antismap, iodelay, alexeymin, geetamc, Pilzschaf, akshaydeo, surgenight, arrowd
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.