qt6-bb10/tests/auto/corelib/global
Marc Mutz 7805b3c32f Only define QT_SUPPORTS_INT128 if type_traits work for them
It turns out that libstdc++ in -ansi mode defines __SIZEOF_INT128__,
but not the corresponding specializations of <type_traits> and
<limits>. This has caused numerous pain points over time, esp. since
is_signed doesn't work, so qt_saturate e.g. can't be used on qint128
inputs e.g.

After another such issue (cmp_equal()), we decided to require
<type_traits> and <limits> support for extended integer types in the
stdlib, or we will disable Qt's support for it, too.

So check that if QT_SUPPORTS_INT128 is defined, is_signed_v,
is_integral_v and numeric_limits work, too. Disable QT_SUPPORTS_INT128
when compiling with libstdc++ in __STRICT_ANSI__ mode (-ansi or
-std=c++NN instead of (the default) -std=gnu++NN).

[ChangeLog][Potentially Source-Incompatible Changes] Qt's support for
128-bit integers (qint128/quint128) is now conditional on support for
these types from the Standard Library, in particular <type_traits> and
<limits>. Qt no longer tries to work around missing Standard Library
support. As a consequence, e.g. GCC -ansi and GCC -std=c++NN (instead
of -std=gnu++NN, the default) builds will now no longer support these
types.

Task-number: QTBUG-119901
Change-Id: I8529e72a52a2f5da0f469bae543688e18220255f
Reviewed-by: Ivan Solovev <ivan.solovev@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
(cherry picked from commit 9bb2ab5978625eee96f703871d5eca8e54b31386)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
2024-08-16 17:34:29 +00:00
..
q20 Add copyright and licensing to build system files missing it 2024-05-21 17:23:21 +02:00
q_func_info Change license for tests files 2024-02-04 09:56:42 +01:00
qcompare Fix partial_ordering::unordered != 0 comparison 2024-08-12 20:18:41 +00:00
qcomparehelpers Qt::totally_ordered_wrapper: do not allow operator*() for void* 2024-08-13 12:56:19 +00:00
qflags Change license for tests files 2024-02-04 09:56:42 +01:00
qfloat16 Fix QT_SUPPORTS_INT128 checks 2024-08-07 19:57:04 +00:00
qgetputenv Change license for tests files 2024-02-04 09:56:42 +01:00
qglobal Only define QT_SUPPORTS_INT128 if type_traits work for them 2024-08-16 17:34:29 +00:00
qglobalstatic Change license for tests files 2024-02-04 09:56:42 +01:00
qhooks Change license for tests files 2024-02-04 09:56:42 +01:00
qkeycombination QKeyCombination: move the operators into namespace Qt 2024-07-31 15:21:36 +00:00
qlibraryinfo qt.conf: add private "merge_qt_conf" option 2024-05-28 20:19:14 +02:00
qlogging ptests: Fix qlogging to use relative folder 2024-05-03 11:58:54 +03:00
qnativeinterface Change license for tests files 2024-02-04 09:56:42 +01:00
qnumeric Fix truncation warnings in tst_qnumeric 2024-03-16 15:41:03 +01:00
qoperatingsystemversion Fix build of tst_qoperatingsystemversion.cpp with C++20 2024-03-19 21:09:38 +01:00
qrandomgenerator Change license for tests files 2024-02-04 09:56:42 +01:00
qtendian Fix QT_SUPPORTS_INT128 checks 2024-08-07 19:57:04 +00:00
qxp Add copyright and licensing to build system files missing it 2024-05-21 17:23:21 +02:00
CMakeLists.txt tst_QCompareHelpers: port to QTEST_THROW_ON_FAIL 2024-06-17 23:17:50 +00:00