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>
This commit is contained in:
Fabian Kosmale 2021-10-01 09:29:21 +02:00
parent fe360a9d52
commit 55689e301c
3 changed files with 0 additions and 48 deletions

View File

@ -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

View File

@ -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
{

View File

@ -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> >