summaryrefslogtreecommitdiffstats
path: root/src/corelib/global/qtypeinfo.h
Commit message (Collapse)AuthorAgeFilesLines
* QTypeInfo: add some code comments regarding a redundant checkGiuseppe D'Angelo2024-04-081-0/+7
| | | | | Change-Id: Ic92f44c8df63bd71f313b672125481d710dc8c66 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTypeInfo: Add a missing includeMartin Storsjö2024-04-041-0/+1
| | | | | | | | | | | | | | | | | | This header uses std::is_trivial_v, which requires including the <type_traits> header. When building with PCH enabled (which is the default), this dependency does get satisfied via the PCH, so no issue is visible. This fixes building with recent version of libc++ when configured with _LIBCPP_REMOVE_TRANSITIVE_INCLUDES (which removes unnecessary transitive dependencies between the libc++ headers, a configuration which may become the default in the future), with PCH disabled. Pick-to: 6.7 6.5 6.2 Change-Id: I5e3ae20e366ed3028b1156cee05bcf2908d6e845 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Revert "QTypeInfo: add detection for Clang's __is_trivially_relocatable"Tor Arne Vestbø2024-03-221-7/+1
| | | | | | | | | This reverts commit f4bac3ca173be9f219099c04e76d6d62c4d0e19e. It broke builds with Xcode 15 Change-Id: Iee232658ede3dfb09d65f3f6a95410c069941421 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QTypeInfo: add detection for Clang's __is_trivially_relocatableGiuseppe D'Angelo2024-03-221-1/+7
| | | | | | | | | | Types marked with [[clang::trivial_abi]] are considered to be trivially relocatable for Clang. This is ABI compatible, since in Qt 6 we can change the value of QTypeInfo::IsRelocatable "after the fact" -- it simply means that code that doesn't get recompiled is pessimized. Change-Id: I32e52bfb212c7919b2ebcf7832ede4404358330f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Refuse to relocate non-copy/move-constructible typesMarc Mutz2023-12-071-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a type was explicitly made non-copyable and non-movable, refuse attempts to mark it as relocatable. Trivial relocatability is an optimization for move+destroy, so we shouldn't allow working around the class author's wish to have a non-movable type by a user making it Q_RELOCATABLE_TYPE. Therefore, add a static_assert() to Q_DECLARE_TYPEINFO that fires when a non-copy/move-constructible type is made Q_RELOCATABLE_TYPE. Also add a similar static assertion to QTypeInfoMerger: All members of a class T may be Q_RELOCATABLE_TYPE. But that doesn't mean that T itself is: class T { QString m_s; QByteArray m_b; Q_DISABLE_COPY(T) public: ~~~~ }; so check that T is actually copyable (or movable) when QTypeInfoMerger would have have yielded isRelocatable. Since Q_DECLARE_TYPEINFO and QTypeInfoMerger are not the only ways in which a user can mark a type as relocatable (manual QTypeInfo specialization is another option, and required, for certain template classes), also check in q_uninitialized_relocate_n(). [ChangeLog][QtCore][QTypeInfo/QTypeInfoMerger] No longer allows marking as Q_RELOCATABLE_TYPE a type that is neither movable nor copyable. Change-Id: If6b3e5c1bfb6538bd280262eefbb08ba3c810e4c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QMetaType: fix recursive detection of std::optional operatorsThiago Macieira2023-07-311-2/+2
| | | | | | | | | | | | | | Commit ca54b741d6edda24773137aacee229db31dd3585 used the internal has_operator_equal (and commit 01d94760d8d34e51e1442682fc151747943c7e25 copied that for has_operator_less_than) instead of using the recursive expander that was being used here. That assumed that the contained type in std::optional would always be the last final check, which is an incorrect assumption. Fixes: QTBUG-115646 Pick-to: 6.6 6.5 Change-Id: Ifbf974a4d10745b099b1fffd177702934bec27ff Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Break cyclic includes in qglobal.h [2/3]Ahmad Samir2023-05-261-4/+5
| | | | | | Task-number: QTBUG-106722 Change-Id: I6cf2b3fcd419659cc8a0633892393febd26e505b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTypeInfo: move helpers in QtPrivate namespaceGiuseppe D'Angelo2023-03-101-4/+8
| | | | | | | | | qIsRelocatable and qIsValueInitializationBitwiseZero are not public API, hide them away. Pick-to: 6.5 6.5.0 Change-Id: Ib4eeaab46d01759098e96091b700e9a28fd50962 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Deprecate QTypeInfo::isPointer and isIntegralGiuseppe D'Angelo2023-02-081-10/+10
| | | | | | | | | | | They're completely superseded by standard traits, and there are no more users in-tree. I'm not hiding them behind a QT_DEPRECATED_SINCE, because these are private APIs, so there's no source compatibility guarantees here. I'm also using [[deprecated]] directly to avoid an extra inclusion after the QtGlobal split. Change-Id: If649e52ffe51c5eba1c51da25b6fe0621a0b17b3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QTypeInfo<std::pair> from qpair.h to qtypeinfo.h to avoid ODR violationMarc Mutz2023-01-101-0/+6
| | | | | | | | | | | | | | | | | | First off, this doesn't cost us anything, because std::pair is defined in <utility>, which qglobal.h unconditionally includes in C++ TUs. More importantly, it prevents ODR violations: when a TU includes only qtypeinfo.h, it will find std::pair<int, int> to be of Q_COMPLEX_TYPE, in constrast with a TU which includes qpair.h, which will find it to be of Q_PRIMITIVE_TYPE instead. [ChangeLog][QtCore][QTypeInfo] The QTypeInfo for std::pair/QPair will now be correct even if qpair.h hasn't been included, fixing an One-Definition-Rule (ODR) violation. Pick-to: 6.5 6.4 6.2 Change-Id: I51f579c123183af25aac9f0ffcf077f752848fb1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTypeInfo: fix pointer detectionGiuseppe D'Angelo2022-12-301-1/+1
| | | | | | | | | | Although redudant, people are allowed to use Q_DECLARE_TYPEINFO on a pointer type. There's no reason to mis-detect the isPointer trait in that case. Change-Id: Ic116f24397c91f5a3d31f5d8ee9fa2e587823257 Pick-to: 5.15 6.2 6.4 6.5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QMetaType: fix value-initialization in a corner caseGiuseppe D'Angelo2022-12-301-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a type is trivially default constructible, QMetaType (and QVariant) think that it can be built and value-initialized by zero-filling a region of storage and then "blessing" that storage as an actual instance of the type to build. This is done as an optimization. This doesn't work for all trivially constructible types. For instance, on the Itanium C++ ABI, pointers to data members are actually value-initialized (= zero-initialized, = initialized to null) with the value -1: https://itanium-cxx-abi.github.io/cxx-abi/abi.html#data-member-pointers This means that a type like struct A { int A::*ptr; }; is trivially constructible, but its value initialization is not equivalent to zero-filling its storage. Since C++ does not offer a type trait we can use for the detection that we want to do here, and since we have also decided that Q_PRIMITIVE_TYPE isn't that trait (it just means trivially copyable / destructible), I'm rolling out a custom type trait for the purpose. This type trait is private for the moment being (there's no Q_DECLARE_TYPEINFO for it), and limited to the subset of scalar types that we know can be value-initialized by memset(0) into their storage (basically, all of them, except for pointers to data members). The fix tries to keep the pre-existing semantics of `QMetaType::NeedsConstruction`. Before, the flag was set for types which were not trivially default constructible. That included types that aren't default constructible, or types that cannot do so trivially. I've left that meaning unchanged, and simply amended the "trivial" part with the custom trait. A fix there (to clarify the semantics) can be done as a separate change. Change-Id: Id8da6acb913df83fc87e5d37e2349a4628e72e91 Pick-to: 6.5 Fixes: QTBUG-109594 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Extract header qtclasshelpermacros.hSona Kurazyan2022-08-191-17/+0
| | | | | | | | | | Move the class helper macros from qglobal.h and Q_DECLARE_SHARED from qtypeinfo.h there. Task-number: QTBUG-99313 Change-Id: I8c8b6241a76916176a48c09fbaf4effc87683770 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Use SPDX license identifiersLucie Gérard2022-05-161-39/+3
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Remove unused Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6Marc Mutz2021-12-031-8/+0
| | | | | | | There are no users left in the tree. Change-Id: I336f4e15c0ec1f5933c1fcfa661bad85bd38ed35 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_qmetatype: Fix operator< detection for std::optionalFabian Kosmale2021-09-211-0/+2
| | | | | | | | | | Amends ca54b741d6edda24773137aacee229db31dd3585. operator< is not constrained in MSVC's standard library, either. Pick-to: 6.2 Fixes: QTBUG-96690 Change-Id: Ibcbb9e53a1f9e8b13786f6d8c01489c61d8d2d7f Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix compilation for recursive Qt containersSona Kurazyan2021-09-071-0/+17
| | | | | | | | | | | | | | | | | | | | The operator checks cause compilation errors when trying to check for their existence for recursive containers. This happens because of trying to check for the operators on the template parameter type(s), that inherit from the container itself, which leads to compilation errors. Introduced alternative versions of the operator checks (with _container suffix), that first check if the container is recursive, i.e. any of its template parameter types inherits from the given container, and skips the operator check, if that's the case. The fix is done for all Qt container types that had the problem, except for QVarLengthArray and QContiguousCache, which don't compile with recursive parameter types for unrelated reasons. Fixes: QTBUG-91707 Pick-to: 6.2 6.1 Change-Id: Ia1e7240b4ce240c1c44f00ca680717d182df7550 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QTypeInfo: Handle T::value_type being equal to TFabian Kosmale2021-03-251-4/+13
| | | | | | | | | | | | | | | | | Fix operator checks for containers whose value_type equals themselves. It does not make sense to recurse on value_type in that case. Thanks to std::disjunction having short-circuiting semantics, we can avoid that issue by checking first whether T is T::value_type. As a drive-by, check for value_type typedef before checking for begin/end in is_container. This works around an issue in gcc <= 8.1, which fails to correctly SFINAE the case where begin and end are private methods. Pick-to: 6.0 6.1 Fixes: QTBUG-89456 Change-Id: I27305a7cfe050f13a279c07f00bc229c01daa25b Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Revert "qtypeinfo: make variable templates inline"Fabian Kosmale2021-03-231-19/+14
| | | | | | | | | | This reverts commit 6de9acf7793a299322923b3ac02142a5e5998842. Reason for revert: This might cause ICEs in clang Task-number: QTBUG-91782 Change-Id: I987d2242b04a22208b54ecbc386a1f6cfc625c1d Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* qcontainerfwd.h: Do not include variant and tupleFabian Kosmale2021-03-211-0/+1
| | | | | | | | | utility is enough to get std::pair; qtypeinfo.h needs to include tuple now though. Change-Id: I9feb625f9feb148b3f3133747ab5405c2eca049d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* qtypeinfo: make variable templates inlineFabian Kosmale2021-03-051-14/+19
| | | | | | | | | | And refactor the TMP to use std::conjunction and use variable template specialization instead of template class specialization for the base cases. Change-Id: Iea6a03f13ea3443a0fa7365af21c496670c1e07f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Replace discouraged Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPEAndreas Buhr2020-11-301-3/+3
| | | | | | | | | | | | | | Q_MOVABLE_TYPE was conceived before C++ had move semantics. Now, with move semantics, its name is misleading. Q_RELOCATABLE_TYPE was introduced as a synonym to Q_MOVABLE_TYPE. Usage of Q_MOVABLE_TYPE is discouraged now. This patch replaces all usages of Q_MOVABLE_TYPE by Q_RELOCATABLE_TYPE in QtBase. As the two are synonymous, this patch should have no impact on users. Pick-to: 6.0 Change-Id: Ie653984363198c1aeb1f70f8e0fa189aae38eb5c Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Cleanup container declarations in qtypeinfo.hLars Knoll2020-11-031-20/+3
| | | | | | | | | | | Use variadic templates to avoid having to use several macros to declare movable containers. Add missing movable declaration for QCache. Change-Id: I32d6a399ef8e6c39021df04deedfbbf0c526fc84 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Code cleanupsLars Knoll2020-11-031-7/+7
| | | | | | | Mark constexpr booleans as inline. Change-Id: Ib7e0f9d96ff3894b72dcd13c07643ef3b9e6e2c5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qtypeinfo.h: We only need a const reference for most operator<<Ulf Hermann2020-10-171-2/+2
| | | | | | | | | If we require a value, then we need a dtor, too. This is not always the case. For example QSessionManager has a private dtor, leading to failures. Change-Id: I3f715848ff5c63b2ea2773c17bced21e7a814ca9 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* QMetaType: Silence float comparison warnings in QEqualityOperatorForTypeUlf Hermann2020-10-161-0/+3
| | | | | | | | We actually do want to invoke the original equality operator there. If that is unsafe, we cannot do much about it at this point. Change-Id: Iadb2eaba1156828d89022d282c41bda57b500b13 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Get rid of some #ifdef qt6Allan Sandfeld Jensen2020-09-301-1/+1
| | | | | | | | | None of this code is even compiled in qt6. Change-Id: I5891cc9459320083ad3908fcbf646f3ba75b8a4d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add operator-> and operator*() to QPropertyFabian Kosmale2020-09-021-0/+10
| | | | | | | | | | | | | | Enable the arrow operator for all types that could have members, so that one can e.g. write myStringProperty->size() instead of having to use the less convenient myStringProperty.value().size(). Also cleaned up the rvalue ref overloads to be disabled for basic types. For those we now also return by value, for more complex types we return a const reference. Change-Id: If6a75898dc0a097f57052488f0af0cd7166b3393 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
* Cleanup QTypeInfoLars Knoll2020-08-261-118/+11
| | | | | | | | | | | | | | | Remove QTypeInfo::isStatic, as that's not used anymore in Qt 6. Also remove sizeOf, it's unused, and we have QMetaType for that if required. Remove all typeinfo declaractions for trivial types, as the default template covers them correctly nowadays. Finally set up a better default for isPointer, and do some smaller cleanups all over the place. Change-Id: I6758ed37dfc701feaaf0ff105cc95e32da9f9c33 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Constrain the data stream operators for containersLars Knoll2020-08-151-0/+11
| | | | | | | | | | | Check that we can successfully instantiate the data stream operator for a container before we actually try. This is required so we can automate registration of debug stream operators with QMetaType. Change-Id: Ib100a5242470d7fc8067058cc4d81af2fa9354b0 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Constrain the debug stream operators for containersLars Knoll2020-08-151-0/+19
| | | | | | | | | | | Check that we can successfully instantiate the debug stream operator for a container before we actually try. This is required so we can automate registration of debug stream operators with QMetaType. Change-Id: I3943e7a443751d250c33b2ca1b9cf29207cfe6c4 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* qtypeinfo: Improve container checkFabian Kosmale2020-07-141-6/+13
| | | | | | | | | | | | | Smart pointers like QSharedPointer<T> do have a value_type, but their equality does not depend on T being comparable. Therefore, instead of simply checking for T::value_type, test for a few other container requirements. This also required to add an additional check for std::optional, as that one has an unconstrained operator== on MSVC. Change-Id: Iefd048f7aa360f4713ecd79f80acd7dae72ee18c Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Constrain the comparison operators for our container classesLars Knoll2020-07-081-0/+5
| | | | | | | | | | | | This had already been in very few places, where we ran into issues with this before. More generic constraints here will significantly reduce the amount of error messages a user has to parse in case he tries to instantiate an operator by accident (or with a lacking comparison operator for one of it's template arguments). Change-Id: I1521d19c55d99732d9742402bd534c390a8e4242 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add type traits to safely determine the existence of comparison operatorsLars Knoll2020-07-081-0/+114
| | | | | | | | | | | | | | | | | | Containers often define an operator==() or operator<() which is very useful for generic code. But those operators can usually not be instantiated if the template argument doesn't implement the operator. This sometimes leads to the compiler trying all possible template expansions and implicit conversions for the type, giving extremely long error messages. The traits support can be used to safely constrain those operators. Being able to safely detect this will also allow us to fold the comparison support that is currently a large cludge for user types directly into QMetaType. Change-Id: Ib84afb5348c3eb0be5161d6ba9d5fe237709c65f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move implementation of QVector/List back to qlist.hLars Knoll2020-06-201-1/+1
| | | | | | | | | | | | | And name the main class QList. That's also the one we document. This gives less porting pain for our users, and a lot less churn in our API, as we use QList in Qt 5 in 95% of our API. In addition, it gives more consistent naming with QStringList and QByteArrayList and disambiguates QList vs QVector(2|3|4)D. Fixes: QTBUG-84468 Change-Id: I3cba9d1d3179969d8bf9320b31be2230d021d1a9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Remove unused functionality from QTypeInfoLars Knoll2020-06-181-31/+1
| | | | | Change-Id: I10fe4cde7a18047599e656cc3bb67b0dfe18a986 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Extend QTypeInfoMerger to more than four argumentsMarc Mutz2020-05-191-15/+11
| | | | | | | | | | | Use template argument pack and C++17 fold expressions. Because MSVC doesn't grok fold expressions in enumerator-definition contexts, use static constexpr bool variables. Change-Id: I13a676d9be687679ef41f7b003e50116c4cd533c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Make QList an alias to QVectorLars Knoll2019-10-301-1/+0
| | | | | | | | | | | | | This is almost 100% source compatible with Qt 5. Exceptions are * Stability of references for large or non movable types * taking a PMF for types that are now overloaded with r-value references in QVector * The missing prepend optimization in QVector (that is still planned to come for Qt 6) Change-Id: I96d44553304dd623def9c70d6fea8fa2fb0373b0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* QTypeInfo: move QLinkedlist declaration to qlinkedlist.hMarc Mutz2019-05-141-1/+0
| | | | | | | This is in preparation of deprecating QLinkedList. Change-Id: Id5018b7fbc89f8b76b86e97cd09d18b4b8cb6234 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove remaining Q_DECL_NOEXCEPT/Q_DECL_NOTHROW usageAllan Sandfeld Jensen2019-04-041-1/+1
| | | | | Change-Id: I91ac9e714a465cab226b211812aa46e8fe5ff2ab Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTypeInfo: use C++11 type traits to deduce if a type is static or complexLars Knoll2018-12-101-4/+24
| | | | | | | | | | | | | | | | | | | All types that can be trivially copied and destructed are by definition relocatable, and we should apply those semantics when moving them in memory. Types that are trivial, are by definition not complex and should be treated as such. [ChangeLog][QtCore] Qt Containers and meta type system now use C++11 type traits (std::is_trivial, std::is_trivially_copyable and std::is_trivially_destructible) to detect the class of a type not explicitly set by Q_DECLARE_TYPEINFO. (Q_DECLARE_TYPEINFO is still needed for QList.) Done-with: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Change-Id: Iebb87ece425ea919e86169d06cd509c54a074282 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-02-281-1/+8
|\ | | | | | | Change-Id: I7d84cfed0b2a122d334b8a920e6e4f18472d2f11
| * QTypeInfo: record whether it was specializedMarc Mutz2017-02-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is one of the pillars of my static container checking toolbox, one of the main checks being that every type put into a Qt container has been marked up with Q_DECLARE_TYPEINFO. Obviously, we cannot upstream such a checker and inflict it upon the world, but we can put some foundations in. This is the most central one. Change-Id: I9185facb2f37ba9fcc12c9aae5675eed454d755c Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QTypeInfo: don't treat enums and (extended) integral types as complexMarc Mutz2017-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | QTypeInfo: make long double primitive in Qt 6 on DarwinGiuseppe D'Angelo2017-02-221-4/+6
|/ | | | | | | | | | I don't know the historical reasons for that, but C++11 mandates long double as a type. On Darwin this means that long double was a complex type, so the best for now is to mark it relocatable. Change-Id: Ic933947a282ad963d5d0168c2768cc98fdd456bc Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use std::enable_if instead of QEnableIfAlexander Volkov2017-01-271-1/+1
| | | | | | Change-Id: Ideca8283141484cb6da47c50333f5c96e416f082 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Remove compiler-specific implementations of Q_IS_ENUMKai Koehne2016-11-091-4/+2
| | | | | | | | | | | 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>
* Replace custom type traits with std one'sKai Koehne2016-11-081-3/+4
| | | | | | | | | | | | | | | | | | 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 <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-03-211-2/+2
|\ | | | | | | | | | | | | | | | | Conflicts: src/widgets/styles/qgtkstyle_p.cpp tests/auto/corelib/io/qtextstream/test/test.pro tests/auto/corelib/plugin/plugin.pro Change-Id: I512bc1b36acf3933ed2b96c00f476ee3819c1f4b
| * QTypeInfoQuery: Add public inheritance specifiersGabriel de Dietrich2016-03-171-2/+2
| | | | | | | | | | | | | | | | | | Their absence offends PySide's shiboken. Change-Id: I137d17e280276f7ffadba6d16b7c230a6880cf05 Reviewed-by: Louai Al-Khanji <louai.al-khanji@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>