We want tst_qfloat16 to be built in C++20 mode, even if Qt itself is not built in C++20 mode, which means we can't use QT_FEATURE_cxx20 as check in tst_qfloat16's CMakeLists.txt. In addition, even if the compiler supports C++20, the standard library may not support all features we need. Specifically, due to the deployment target of macOS being 12 we can't rely on std::to_chars being available, as is only available since macOS 13.4. This patch introduces a separate QT_FEATURE_cxx20_format, and adjusts the tst_qfloat16's CMakeLists.txt to use this feature. Note that we intentionally do not add QT_FEATURE_cxx20 as a hard condition to the new check, because it might be disabled during the Qt configuration, but we still want the test to be built in C++20 mode. Note also, that we cannot use the QT_CONFIG(cxx20_format) check in the qtformat_impl.h header, because the std::format support is header-only, and user project might be compiled for a different minimal macOS version, so we do not want to rely on the Qt-specific config. Pick-to: 6.9 6.8 Change-Id: Ibc43d243dbb24fcb922647fe2d90f61491144eb7 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
…
…
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%