[Bug libstdc++/121811] stdckdint.h fails to compile in C++26 mode in GCC 14

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Jan 26 21:37:17 GMT 2026


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=121811

--- Comment #18 from Jonathan Wakely <redi at gcc dot gnu.org> ---
(In reply to Jonathan Wakely from comment #16)
> I think I'll file an NB comment for C++26 saying that C++ should add its own
> macro to that file (and stdbit.h) so that programs can tell whether they're
> getting a C++-aware header or not. The current spec doesn't make that
> possible.

Discussing this with Barry a while ago, I realised that adding the new
__cpp_lib_stdcktint_h macro to stdckdint.h itself doesn't help. If you include
<stdckdint.h> and it's not a C++26 version, it's too late. It already broke
your compilation, because it uses _Bool or _Generic or something.

But as long as the __cpp_lib_stdckdint_h macro is in <version>, you can include
that and check for the macro before you try to include <stdckdint.h>.


More information about the Gcc-bugs mailing list