[Development] Proposing to officially allow C++20 types in Qt 6 ABIs

Thiago Macieira thiago.macieira at intel.com
Thu Jan 27 17:19:10 CET 2022


On Thursday, 27 January 2022 03:38:05 PST Marc Mutz wrote:
> The only difference would be that a C++20 project would require a C++20(or
> later)-build of Qt. The error upon failure to comply would be
> unspectacular: linker not finding a symbol in the Qt library.

That's the problem and the thing that makes your proposal unacceptable.

We know a great deal of our users use the binary builds by the Qt Company. In 
order to make those the most widely supported, they are compiled with the 
oldest compiler we still support. Therefore, we must limit ourselves to what 
those have in our pre-built ABI.

If you meant to use the C++20 types that those compilers have, then we can 
proceed. But we will need an analysis of support for every single such type as 
they are added to the codebase.

Let's start with your example:

gcc $ git -P log --oneline --diff-filter=A libstdc++-v3/include/std/span
95e9a7616d3 Implement std::span for C++20
gcc $ git describe 95e9a7616d3
basepoints/gcc-10-2978-g95e9a7616d3
gcc $ cd ../llvm-project
llvm-project $ git -P log --oneline --diff-filter=A libcxx/include/span
8a0794b722bd Implement <span>. Reviewed as https://reviews.llvm.org/D49338
llvm-project $ git tag --contains 8a0794b722bd | head -1
llvmorg-7.0.0-rc1

std::span was introduced to GCC's libstdc++ with GCC 10 and with libc++ 7.0.0. 
I don't know what the minimum Clang version we require is, particularly since 
Apple doesn't use the same numbering for Xcode, but GCC 10 is too new and we 
support GCC 9. See https://doc.qt.io/qt-6/supported-platforms.html.

Therefore, we can't use std::span in our ABI just yet.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel DPG Cloud Engineering





More information about the Development mailing list