diff options
author | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-10-01 09:29:21 +0200 |
---|---|---|
committer | Fabian Kosmale <fabian.kosmale@qt.io> | 2021-10-02 12:47:43 +0200 |
commit | 55689e301c74b2ef20b9283ebb29417ef1657fe2 (patch) | |
tree | b8dbb95f1367e176448fe95a699c33fe5d3cc04b | |
parent | fe360a9d52ad7cdf8819ca84031d6c21e22a33a1 (diff) |
Purge Q_NO_TEMPLATE_FRIENDS and platforms lacking support for them
Given that we rely on C++17, it should be safe to mandate that level of
language support.
Change-Id: If07ccb36bea2a5113a8f5aacf635be7d2590baf7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | src/corelib/global/qcompilerdetection.h | 32 | ||||
-rw-r--r-- | src/corelib/tools/qsharedpointer_impl.h | 12 | ||||
-rw-r--r-- | src/gui/math3d/qgenericmatrix.h | 4 |
3 files changed, 0 insertions, 48 deletions
diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 584f1f79b9..273575c31f 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -409,15 +409,6 @@ documentation. It also follows conventions like _BOOL and this documented */ # elif defined(sinix) # define Q_CC_CDS - -/* The MIPSpro compiler defines __EDG */ -# elif defined(__sgi) -# define Q_CC_MIPS -# define Q_NO_TEMPLATE_FRIENDS -# if defined(_COMPILER_VERSION) && (_COMPILER_VERSION >= 740) -# define Q_OUTOFLINE_TEMPLATE inline -# pragma set woff 3624,3625,3649 /* turn off some harmless warnings */ -# endif # endif /* VxWorks' DIAB toolchain has an additional EDG type C++ compiler @@ -446,9 +437,6 @@ # if __SUNPRO_CC >= 0x550 # define Q_DECL_EXPORT __global # endif -# if __SUNPRO_CC < 0x5a0 -# define Q_NO_TEMPLATE_FRIENDS -# endif # if !defined(_BOOL) # error "Compiler not supported" # endif @@ -467,26 +455,6 @@ # endif # define Q_BROKEN_TEMPLATE_SPECIALIZATION -#elif defined(Q_OS_HPUX) -/* __HP_aCC was not defined in first aCC releases */ -# if defined(__HP_aCC) || __cplusplus >= 199707L -# define Q_NO_TEMPLATE_FRIENDS -# define Q_CC_HPACC -# define Q_FUNC_INFO __PRETTY_FUNCTION__ -# if __HP_aCC-0 < 060000 -# define QT_NO_TEMPLATE_TEMPLATE_PARAMETERS -# define Q_DECL_EXPORT __declspec(dllexport) -# define Q_DECL_IMPORT __declspec(dllimport) -# endif -# if __HP_aCC-0 >= 062000 -# define Q_DECL_EXPORT __attribute__((visibility("default"))) -# define Q_DECL_HIDDEN __attribute__((visibility("hidden"))) -# define Q_DECL_IMPORT Q_DECL_EXPORT -# endif -# else -# error "Compiler not supported" -# endif - #else # error "Qt has not been tested with this compiler - see http://www.qt-project.org/" #endif diff --git a/src/corelib/tools/qsharedpointer_impl.h b/src/corelib/tools/qsharedpointer_impl.h index 0e51990ae3..0db62d9ef4 100644 --- a/src/corelib/tools/qsharedpointer_impl.h +++ b/src/corelib/tools/qsharedpointer_impl.h @@ -512,13 +512,9 @@ private: qSwap(this->value, other.value); } -#if defined(Q_NO_TEMPLATE_FRIENDS) -public: -#else template <class X> friend class QSharedPointer; template <class X> friend class QWeakPointer; template <class X, class Y> friend QSharedPointer<X> QtSharedPointer::copyAndSetPointer(X * ptr, const QSharedPointer<Y> &src); -#endif void ref() const noexcept { d->weakref.ref(); d->strongref.ref(); } inline void internalSet(Data *o, T *actual) @@ -676,12 +672,8 @@ public: private: friend struct QtPrivate::EnableInternalData; -#if defined(Q_NO_TEMPLATE_FRIENDS) -public: -#else template <class X> friend class QSharedPointer; template <class X> friend class QPointer; -#endif template <class X> inline QWeakPointer &assign(X *ptr) @@ -738,12 +730,8 @@ public: inline QSharedPointer<T> sharedFromThis() { return QSharedPointer<T>(weakPointer); } inline QSharedPointer<const T> sharedFromThis() const { return QSharedPointer<const T>(weakPointer); } -#ifndef Q_NO_TEMPLATE_FRIENDS private: template <class X> friend class QSharedPointer; -#else -public: -#endif template <class X> inline void initializeFromSharedPointer(const QSharedPointer<X> &ptr) const { diff --git a/src/gui/math3d/qgenericmatrix.h b/src/gui/math3d/qgenericmatrix.h index 9d8869ff3a..47a77d1e52 100644 --- a/src/gui/math3d/qgenericmatrix.h +++ b/src/gui/math3d/qgenericmatrix.h @@ -79,7 +79,6 @@ public: const T *data() const { return *m; } const T *constData() const { return *m; } -#if !defined(Q_NO_TEMPLATE_FRIENDS) template<int NN, int MM, typename TT> friend QGenericMatrix<NN, MM, TT> operator+(const QGenericMatrix<NN, MM, TT>& m1, const QGenericMatrix<NN, MM, TT>& m2); template<int NN, int MM, typename TT> @@ -96,13 +95,10 @@ public: friend QGenericMatrix<NN, MM, TT> operator/(const QGenericMatrix<NN, MM, TT>& matrix, TT divisor); private: -#endif T m[N][M]; // Column-major order to match OpenGL. -#if !defined(Q_NO_TEMPLATE_FRIENDS) template <int NN, int MM, typename TT> friend class QGenericMatrix; -#endif }; template <int N, int M, typename T> class QTypeInfo<QGenericMatrix<N, M, T> > |