diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2017-02-20 13:50:35 +0100 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2017-02-22 09:21:57 +0000 |
commit | 7c647edae928d27343b64b5e0f0805920b754110 (patch) | |
tree | 350e3fd0db42c9db18632e9a059b73a32a4dafa8 /src/corelib/global/qtypeinfo.h | |
parent | 19085350fb3b9de89a4c3e5a6c1c7bbb2a43c324 (diff) |
QTypeInfo: don't treat enums and (extended) integral types as complex
We fully specialize QTypeInfo for most C++ built-in types,
but enums and extended integral types (like GCC's int128_t)
were not covered.
Now that we depend on <type_traits>, we can stop pessimizing
enums and extended integral types in QVector and QVLA by
defaulting QTypeInfo::isComplex to true for such types.
Fix a test that checked that enums were complex types. This should
have been a XFAIL test. Enums are not complex types.
Change-Id: Ibb0fb38cc83e980a428b5573d1db5666593418ae
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/global/qtypeinfo.h')
-rw-r--r-- | src/corelib/global/qtypeinfo.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/corelib/global/qtypeinfo.h b/src/corelib/global/qtypeinfo.h index 53f6b3fff6..cbba253a75 100644 --- a/src/corelib/global/qtypeinfo.h +++ b/src/corelib/global/qtypeinfo.h @@ -60,7 +60,7 @@ public: enum { isPointer = false, isIntegral = std::is_integral<T>::value, - isComplex = true, + isComplex = !isIntegral && !std::is_enum<T>::value, isStatic = true, isRelocatable = std::is_enum<T>::value, isLarge = (sizeof(T)>sizeof(void*)), |