summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@qt.io>2016-08-08 09:05:53 +0200
committerKai Koehne <kai.koehne@qt.io>2016-11-09 09:13:01 +0000
commit5c3b16706ff30c38258df0e98e071bf8ae6a1460 (patch)
treede61c04573a43f16fc48b33b6402e78678ff5e03 /src/corelib
parentb64fc69d1c8a54ee311ea115c5c01823b0868d18 (diff)
Remove compiler-specific implementations of Q_IS_ENUM
Since the macro is now just a wrapper for std::is_enum, its use is also deprecated. [ChangeLog][QtCore][Global] Q_IS_ENUM is deprecated. Use std::is_enum<>::value instead. Change-Id: I09b9f4559c02c81f338cace927873318f2acafde Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qisenum.h17
-rw-r--r--src/corelib/global/qtypeinfo.h6
-rw-r--r--src/corelib/kernel/qmetatype.h3
-rw-r--r--src/corelib/kernel/qvariant_p.h2
4 files changed, 6 insertions, 22 deletions
diff --git a/src/corelib/global/qisenum.h b/src/corelib/global/qisenum.h
index 185db5e45f..8f784ef6e3 100644
--- a/src/corelib/global/qisenum.h
+++ b/src/corelib/global/qisenum.h
@@ -42,21 +42,8 @@
#ifndef QISENUM_H
#define QISENUM_H
-#ifndef Q_IS_ENUM
-# if defined(Q_CC_GNU) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
-# define Q_IS_ENUM(x) __is_enum(x)
-# elif defined(Q_CC_MSVC) && defined(_MSC_FULL_VER) && (_MSC_FULL_VER >=140050215)
-# define Q_IS_ENUM(x) __is_enum(x)
-# elif defined(Q_CC_CLANG)
-# if __has_extension(is_enum)
-# define Q_IS_ENUM(x) __is_enum(x)
-# endif
-# endif
-#endif
-
-#ifndef Q_IS_ENUM
-# define Q_IS_ENUM(x) std::is_enum<x>::value
-#endif
+// Use of Q_IS_ENUM is deprecated since 5.8
+#define Q_IS_ENUM(x) std::is_enum<x>::value
// shut up syncqt
QT_BEGIN_NAMESPACE
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h
index cdc85ab1d0..8aa5cb4fb4 100644
--- a/src/corelib/global/qtypeinfo.h
+++ b/src/corelib/global/qtypeinfo.h
@@ -38,13 +38,11 @@
**
****************************************************************************/
-#include <QtCore/qisenum.h>
+#include <QtCore/qglobal.h>
#ifndef QTYPEINFO_H
#define QTYPEINFO_H
-#include <QtCore/qglobal.h>
-
QT_BEGIN_NAMESPACE
/*
@@ -64,7 +62,7 @@ public:
isIntegral = std::is_integral<T>::value,
isComplex = true,
isStatic = true,
- isRelocatable = Q_IS_ENUM(T),
+ isRelocatable = std::is_enum<T>::value,
isLarge = (sizeof(T)>sizeof(void*)),
isDummy = false, //### Qt6: remove
sizeOf = sizeof(T)
diff --git a/src/corelib/kernel/qmetatype.h b/src/corelib/kernel/qmetatype.h
index 29e60b0eb5..e64812b3ae 100644
--- a/src/corelib/kernel/qmetatype.h
+++ b/src/corelib/kernel/qmetatype.h
@@ -45,7 +45,6 @@
#include <QtCore/qatomic.h>
#include <QtCore/qbytearray.h>
#include <QtCore/qvarlengtharray.h>
-#include <QtCore/qisenum.h>
#ifndef QT_NO_QOBJECT
#include <QtCore/qobjectdefs.h>
#endif
@@ -1635,7 +1634,7 @@ namespace QtPrivate {
| (IsSharedPointerToTypeDerivedFromQObject<T>::Value ? QMetaType::SharedPointerToQObject : 0)
| (IsWeakPointerToTypeDerivedFromQObject<T>::Value ? QMetaType::WeakPointerToQObject : 0)
| (IsTrackingPointerToTypeDerivedFromQObject<T>::Value ? QMetaType::TrackingPointerToQObject : 0)
- | (Q_IS_ENUM(T) ? QMetaType::IsEnumeration : 0)
+ | (std::is_enum<T>::value ? QMetaType::IsEnumeration : 0)
| (IsGadgetHelper<T>::Value ? QMetaType::IsGadget : 0)
};
};
diff --git a/src/corelib/kernel/qvariant_p.h b/src/corelib/kernel/qvariant_p.h
index ec87e20656..bf88def438 100644
--- a/src/corelib/kernel/qvariant_p.h
+++ b/src/corelib/kernel/qvariant_p.h
@@ -65,7 +65,7 @@ template<typename T>
struct QVariantIntegrator
{
static const bool CanUseInternalSpace = sizeof(T) <= sizeof(QVariant::Private::Data)
- && ((QTypeInfoQuery<T>::isRelocatable) || Q_IS_ENUM(T));
+ && ((QTypeInfoQuery<T>::isRelocatable) || std::is_enum<T>::value);
typedef std::integral_constant<bool, CanUseInternalSpace> CanUseInternalSpace_t;
};
Q_STATIC_ASSERT(QVariantIntegrator<double>::CanUseInternalSpace);