From ed7f77071dcca996a8c8147fd66344090666e60c Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Fri, 5 Aug 2016 10:12:12 +0200 Subject: Replace custom type traits with std one's Remove most type traits from qtypetraits.h, but keep the custom implementation of is_signed/is_unsigned. This gets rid of BSD-3 licensed code from Google in a public header (hugh!). The custom implementations for is_signed/is_unsigned are kept because the implementations in gcc's standard headers do not work as we expect for enums - both is_signed and is_unsigned always returns false there - see also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59027 [ChangeLog][QtCore][General] Qt now relies on type traits from the C++ standard library. Change-Id: I3f2188b46949f04ca4482a6ac9afd3482103f0e1 Reviewed-by: Thiago Macieira --- tests/auto/corelib/global/qglobal/tst_qglobal.cpp | 5 ++--- tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp | 3 +-- 2 files changed, 3 insertions(+), 5 deletions(-) (limited to 'tests') diff --git a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp index 9b92a4ff15..ff0497b69e 100644 --- a/tests/auto/corelib/global/qglobal/tst_qglobal.cpp +++ b/tests/auto/corelib/global/qglobal/tst_qglobal.cpp @@ -28,7 +28,6 @@ #include -#include #include #include @@ -376,8 +375,8 @@ void tst_QGlobal::isEnum() #define IS_ENUM_TRUE(x) (Q_IS_ENUM(x) == true) #define IS_ENUM_FALSE(x) (Q_IS_ENUM(x) == false) #else -#define IS_ENUM_TRUE(x) (Q_IS_ENUM(x) == true && QtPrivate::is_enum::value == true) -#define IS_ENUM_FALSE(x) (Q_IS_ENUM(x) == false && QtPrivate::is_enum::value == false) +#define IS_ENUM_TRUE(x) (Q_IS_ENUM(x) == true && std::is_enum::value == true) +#define IS_ENUM_FALSE(x) (Q_IS_ENUM(x) == false && std::is_enum::value == false) #endif QVERIFY(IS_ENUM_TRUE(isEnum_B_Byte)); diff --git a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp index 1a70ac5e75..0c890eafbc 100644 --- a/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp +++ b/tests/auto/corelib/tools/qhashfunctions/tst_qhashfunctions.cpp @@ -29,7 +29,6 @@ #include #include -#include #include #include @@ -197,7 +196,7 @@ void tst_QHashFunctions::range() { // verify that the input iterator category suffices: std::stringstream sstream; - Q_STATIC_ASSERT((QtPrivate::is_same::iterator_category>::value)); + Q_STATIC_ASSERT((std::is_same::iterator_category>::value)); std::copy(ints, ints + numInts, std::ostream_iterator(sstream, " ")); sstream.seekg(0); std::istream_iterator it(sstream), end; -- cgit v1.2.3