Fix build with Qt 5.14
ClosedPublic

Authored by alexeymin on Oct 24 2019, 11:38 AM.

Details

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

Diff Detail

Repository
R51 KDevelop: PG Qt
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
alexeymin created this revision.Oct 24 2019, 11:38 AM
Restricted Application added a project: KDevelop. · View Herald TranscriptOct 24 2019, 11:38 AM
Restricted Application added a subscriber: kdevelop-devel. · View Herald Transcript
alexeymin requested review of this revision.Oct 24 2019, 11:38 AM
apol accepted this revision.Oct 24 2019, 12:26 PM
This revision is now accepted and ready to land.Oct 24 2019, 12:26 PM
This revision was automatically updated to reflect the committed changes.