summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2020-06-16 11:46:30 +0200
committerLars Knoll <lars.knoll@qt.io>2020-06-18 12:02:51 +0200
commit7b5d5faae19d1872faafaf05c9acf21b33d327fe (patch)
treecaa94b7ac443f2309888ff8a599df4d9deadd9fb
parent7e83f09eadc54fb3a9ae89598a42b7dc0aa2828c (diff)
Remove unused functionality from QTypeInfo
Change-Id: I10fe4cde7a18047599e656cc3bb67b0dfe18a986 Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
-rw-r--r--src/corelib/global/qtypeinfo.h32
-rw-r--r--tests/auto/corelib/global/qflags/tst_qflags.cpp2
-rw-r--r--tests/auto/corelib/tools/qpair/tst_qpair.cpp1
3 files changed, 1 insertions, 34 deletions
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h
index e16ffb08ee..175d5205af 100644
--- a/src/corelib/global/qtypeinfo.h
+++ b/src/corelib/global/qtypeinfo.h
@@ -52,21 +52,13 @@ QT_BEGIN_NAMESPACE
template <typename T>
static constexpr bool qIsRelocatable()
{
-#if defined(Q_CC_CLANG) || !defined(Q_CC_GNU) || Q_CC_GNU >= 501
return std::is_trivially_copyable<T>::value && std::is_trivially_destructible<T>::value;
-#else
- return std::is_enum<T>::value || std::is_integral<T>::value;
-#endif
}
template <typename T>
static constexpr bool qIsTrivial()
{
-#if defined(Q_CC_CLANG) || !defined(Q_CC_GNU) || Q_CC_GNU >= 501
return std::is_trivial<T>::value;
-#else
- return std::is_enum<T>::value || std::is_integral<T>::value;
-#endif
}
/*
@@ -78,14 +70,11 @@ class QTypeInfo
{
public:
enum {
- isSpecialized = std::is_enum<T>::value, // don't require every enum to be marked manually
isPointer = false,
isIntegral = std::is_integral<T>::value,
isComplex = !qIsTrivial<T>(),
isStatic = true,
isRelocatable = qIsRelocatable<T>(),
- isLarge = (sizeof(T)>sizeof(void*)),
- isDummy = false, //### Qt6: remove
sizeOf = sizeof(T)
};
};
@@ -95,14 +84,11 @@ class QTypeInfo<void>
{
public:
enum {
- isSpecialized = true,
isPointer = false,
isIntegral = false,
isComplex = false,
isStatic = false,
isRelocatable = false,
- isLarge = false,
- isDummy = false,
sizeOf = 0
};
};
@@ -112,14 +98,11 @@ class QTypeInfo<T*>
{
public:
enum {
- isSpecialized = true,
isPointer = true,
isIntegral = false,
isComplex = false,
isStatic = false,
isRelocatable = true,
- isLarge = false,
- isDummy = false,
sizeOf = sizeof(T*)
};
};
@@ -175,14 +158,11 @@ class QTypeInfoMerger
{
static_assert(sizeof...(Ts) > 0);
public:
- static constexpr bool isSpecialized = true;
static constexpr bool isComplex = ((QTypeInfoQuery<Ts>::isComplex) || ...);
static constexpr bool isStatic = ((QTypeInfoQuery<Ts>::isStatic) || ...);
static constexpr bool isRelocatable = ((QTypeInfoQuery<Ts>::isRelocatable) && ...);
- static constexpr bool isLarge = sizeof(T) > sizeof(void*);
static constexpr bool isPointer = false;
static constexpr bool isIntegral = false;
- static constexpr bool isDummy = false;
static constexpr std::size_t sizeOf = sizeof(T);
};
@@ -193,14 +173,11 @@ class QTypeInfo< CONTAINER<T> > \
{ \
public: \
enum { \
- isSpecialized = true, \
isPointer = false, \
isIntegral = false, \
isComplex = true, \
isRelocatable = true, \
isStatic = false, \
- isLarge = (sizeof(CONTAINER<T>) > sizeof(void*)), \
- isDummy = false, \
sizeOf = sizeof(CONTAINER<T>) \
}; \
}
@@ -212,7 +189,6 @@ Q_DECLARE_MOVABLE_CONTAINER(QSet);
#undef Q_DECLARE_MOVABLE_CONTAINER
-/* These cannot be movable before ### Qt 6, for BC reasons */
#define Q_DECLARE_MOVABLE_CONTAINER(CONTAINER) \
template <typename K, typename V> class CONTAINER; \
template <typename K, typename V> \
@@ -220,14 +196,11 @@ class QTypeInfo< CONTAINER<K, V> > \
{ \
public: \
enum { \
- isSpecialized = true, \
isPointer = false, \
isIntegral = false, \
isComplex = true, \
- isStatic = (QT_VERSION < QT_VERSION_CHECK(6, 0, 0)), \
+ isStatic = false, \
isRelocatable = true, \
- isLarge = (sizeof(CONTAINER<K, V>) > sizeof(void*)), \
- isDummy = false, \
sizeOf = sizeof(CONTAINER<K, V>) \
}; \
}
@@ -261,14 +234,11 @@ class QTypeInfo<TYPE > \
{ \
public: \
enum { \
- isSpecialized = true, \
isComplex = (((FLAGS) & Q_PRIMITIVE_TYPE) == 0) && !qIsTrivial<TYPE>(), \
isStatic = (((FLAGS) & (Q_MOVABLE_TYPE | Q_PRIMITIVE_TYPE)) == 0), \
isRelocatable = !isStatic || ((FLAGS) & Q_RELOCATABLE_TYPE) || qIsRelocatable<TYPE>(), \
- isLarge = (sizeof(TYPE)>sizeof(void*)), \
isPointer = false, \
isIntegral = std::is_integral< TYPE >::value, \
- isDummy = (((FLAGS) & Q_DUMMY_TYPE) != 0), \
sizeOf = sizeof(TYPE) \
}; \
static inline const char *name() { return #TYPE; } \
diff --git a/tests/auto/corelib/global/qflags/tst_qflags.cpp b/tests/auto/corelib/global/qflags/tst_qflags.cpp
index be75f5b3cc..4df448373d 100644
--- a/tests/auto/corelib/global/qflags/tst_qflags.cpp
+++ b/tests/auto/corelib/global/qflags/tst_qflags.cpp
@@ -151,7 +151,6 @@ Q_DECLARE_FLAGS( MyStrictNoOpFlags, MyStrictNoOpEnum )
Q_STATIC_ASSERT( !QTypeInfo<MyStrictFlags>::isComplex );
Q_STATIC_ASSERT( !QTypeInfo<MyStrictFlags>::isStatic );
-Q_STATIC_ASSERT( !QTypeInfo<MyStrictFlags>::isLarge );
Q_STATIC_ASSERT( !QTypeInfo<MyStrictFlags>::isPointer );
void tst_QFlags::classEnum()
@@ -322,7 +321,6 @@ Q_DECLARE_OPERATORS_FOR_FLAGS( MyFlags )
Q_STATIC_ASSERT( !QTypeInfo<MyFlags>::isComplex );
Q_STATIC_ASSERT( !QTypeInfo<MyFlags>::isStatic );
-Q_STATIC_ASSERT( !QTypeInfo<MyFlags>::isLarge );
Q_STATIC_ASSERT( !QTypeInfo<MyFlags>::isPointer );
QTEST_MAIN(tst_QFlags)
diff --git a/tests/auto/corelib/tools/qpair/tst_qpair.cpp b/tests/auto/corelib/tools/qpair/tst_qpair.cpp
index 0a158e5860..6ea1b18df2 100644
--- a/tests/auto/corelib/tools/qpair/tst_qpair.cpp
+++ b/tests/auto/corelib/tools/qpair/tst_qpair.cpp
@@ -89,7 +89,6 @@ Q_STATIC_ASSERT(!QTypeInfo<QPairPM>::isStatic );
Q_STATIC_ASSERT(!QTypeInfo<QPairPP>::isComplex);
Q_STATIC_ASSERT(!QTypeInfo<QPairPP>::isStatic );
-Q_STATIC_ASSERT(!QTypeInfo<QPairPP>::isDummy );
Q_STATIC_ASSERT(!QTypeInfo<QPairPP>::isPointer);