Does libstdc++-16 stabilize the C++20 ABI?

Daniel Grunwald via Gcc-help <[email protected]> Mon, 27 Apr 2026 16:01:10 +0200
Newsgroups gmane.comp.gcc.help
Message-ID <[email protected]>
I found some contradictory information:

<https://gcc.gnu.org/projects/cxx-status.html#cxx20> claims yes:
 > Some C++20 features are available since GCC 8, but support was
 > experimental and the ABI of C++20 features was not stable until
 > GCC 16. C++20 modules support is still experimental.

But <https://gcc.gnu.org/gcc-16/changes.html#libstdcxx> claims the opposite:
 > As with all experimental support, programs using C++20 components
 > should assume that those components are not compatible between
 > different major releases.

Can you clarify?


Additionally, let me ask about a concrete scenario:

1. We build a shared library with `g++-16 -std=c++20 -fvisibility=hidden`
2. The public headers for our library only use C++17 features (and we 
test that C++17 code can consume our library)
3. This library ends up being used in an application compiled with 
g++-17 and running with libstdc++-17 (or maybe even with a version 
further in the future).

In this scenario, it seems to me that the interface between our shared 
library and the application does not care about the ABI stability of 
C++20 types, since those are not involved in the interface. C++20 types 
only matter for the stability of the interface between our shared 
library and libstdc++.so.6.

Does this mean our library could use experimental language versions 
(e.g. C++23) right now? Or is the libstdc++.so.6 ABI stability also 
restricted to stabilized language versions? I was not able to find any 
documentation on this. In particular, I checked 
<https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html> but that 
makes no mention of experimental language versions.

-- 
Daniel Grunwald

The Qt Company GmbH
Bremen office
c/o Regus | Karl-Ferdinand-Braun-Straße 5
28359 Bremen | Germany

Managing Directors: Mika Pälsi, Juha Varelius, Jouni Lintunen
Registered Office: Berlin
Registration Court: Amtsgericht Charlottenburg, HRB 144331 B

Mandatory information according to Art. 13 GDPR: 
https://www.qt.io/terms-conditions/privacy-policy