[Development] Switching Qt default builds to C++20 where supported

Thiago Macieira thiago.macieira at intel.com
Mon Oct 28 17:13:27 CET 2024


On Monday 28 October 2024 08:39:59 Pacific Daylight Time Fabian Kosmale via 
Development wrote:
> 1. Ensuring that CI gives us enough test coverage, which I suspect might be
> solvable by configuring Qt  to build examples and tests by default still
> with 17. 

I'll investigate, but I've never looked into how the CI tests compiling the 
examples.  I also don't think it's worthwhile looking at the examples for 
this, for two reasons: 1) the headerchecking will be superior for the majority 
of issues, leaving only template expansions as problematic and our examples 
are not very template-heavy; 2) it may make sense to use new C++20 features in 
the examples.

Compiling some of the tests in C++17 may make sense, but it might reduce 
coverage of the test itself.

Do remember that there will be some platforms defaulting to C++17, so we'll 
keep support for that.

> 2. Compile times, which I see getting worse when switching to 20,
> and not improving until we can use "import std". And that's not probably
> not viable even in C++23 builds unless mixing and matching of import and
> include of SLT headers works reliably. I don't consider compiles slower a
> blocker though, especially if compiling in 17 mode is still possible.

Yeah, nothing we can do about that trend.

> However, if it comes to ABI, I'm not convinced that we have a solution. As
> long as e.g. libstdc++ declares its support experimental, are we really
> willing to export C++20 symbols from Qt? If not, do we have strategy to
> prevent this from happening?

We don't have a solution for ABI-use right now, unless we can convince the 
libstdc++ maintainers to keep their current ABI for us. If all Jonathan wants 
is a beer count, I'll provide it :)

Our current rules should be more than enough to prevent unintentional use of 
their ABI in ours.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Principal Engineer - Intel DCAI Platform & System Engineering
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5152 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/development/attachments/20241028/346e51c2/attachment-0001.bin>


More information about the Development mailing list