Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-100276

[spike] C++20 types in the ABI



    • Task
    • Resolution: Won't Do
    • P2: Important
    • None
    • None
    • Core: Other, Other
    • None
    • 13
    • Team Two Foundation Sprint 51, Team Two Foundation Sprint 52, Team B Foundation Sprint 53, Foundation PM Prioritized


      C++20 brings several new library features that would be great to use in the Qt API, foremost among them are coroutines and std::span. Yet, both of these are in a sense type-erasure techniques, and therefore most useful across ABI boundaries.

      Traditionally, Qt has defined a set of minimum supported C++ compilers and whatever their lowest common denominator was, that's what could be used in the Qt ABI, everything else, let's call is conditionally-supported, could only be used in inline API.

      It is worth noting that on MSVC, inline API in exported classes already forms part of the ABI, and no-one seems to have cared.

      We should, therefore, discuss whether we soften our ABI guidelines such that we can use said conditionally-supported types also in the ABI. This would allow to create non-inline APIs that use std::span and coroutines without having to wait for all compilers to support them.

      This is not such a big step: We already have that, de facto, in MSVC. 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.

      So, seeing as we have allowed C++latest types in our ABI de-facto in the past, I think it's time to allow it de-jure, too.


        No reviews matched the request. Check your Options in the drop-down menu of this sections header.



            mmutz Marc Mutz
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            1 Vote for this issue
            6 Start watching this issue



              Gerrit Reviews

                There are no open Gerrit changes