From 5c01cbfe7670ef2d4d0267e0cd114ab02c390042 Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Fri, 19 Aug 2022 17:24:37 +0200 Subject: [PATCH] Remove Q_DUMMY_COMPARISON_OPERATOR It's not needed for any of our supported compilers and isn't used in Qt codbase anymore. It was only required for IBM xlC compiler, which doesn't seem to support C++17 at the moment (when it does, hopefully they will also fix the issue). [ChangeLog][QtGlobal] Removed the Q_DUMMY_COMPARISON_OPERATOR macro, which was needed to workaround outdated template instantiation rules on some outdated compilers. Fixes: QTBUG-105098 Change-Id: I2b992dd8c0f389d874d2a8521fc1a1aad3f80699 Reviewed-by: Thiago Macieira Reviewed-by: Fabian Kosmale --- src/corelib/global/qcompilerdetection.h | 1 - src/corelib/global/qtclasshelpermacros.h | 20 -------------------- 2 files changed, 21 deletions(-) diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 5931d16711a..27813f880d4 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -223,7 +223,6 @@ but it is not defined on older compilers like C Set 3.1 */ #elif defined(__xlC__) # define Q_CC_XLC -# define Q_FULL_TEMPLATE_INSTANTIATION # if __xlC__ < 0x400 # error "Compiler not supported" # elif __xlC__ >= 0x0600 diff --git a/src/corelib/global/qtclasshelpermacros.h b/src/corelib/global/qtclasshelpermacros.h index 6e72b0f7c1c..e6b66ed5f2c 100644 --- a/src/corelib/global/qtclasshelpermacros.h +++ b/src/corelib/global/qtclasshelpermacros.h @@ -100,26 +100,6 @@ template inline auto qGetPtrHelper(Ptr &ptr) noexcept -> decltype #define Q_D(Class) Class##Private * const d = d_func() #define Q_Q(Class) Class * const q = q_func() -/* - Compilers which follow outdated template instantiation rules - require a class to have a comparison operator to exist when - a QList of this type is instantiated. It's not actually - used in the list, though. Hence the dummy implementation. - Just in case other code relies on it we better trigger a warning - mandating a real implementation. -*/ - -#ifdef Q_FULL_TEMPLATE_INSTANTIATION -# define Q_DUMMY_COMPARISON_OPERATOR(C) \ - bool operator==(const C&) const { \ - qWarning(#C"::operator==(const "#C"&) was called"); \ - return false; \ - } -#else - -# define Q_DUMMY_COMPARISON_OPERATOR(C) -#endif - /* Specialize a shared type with: