[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
Sat Sep 6 09:24:33 GMT 2025


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

--- Comment #16 from Jonathan Wakely <redi at gcc dot gnu.org> ---
That would allow this in C++: ckd_add(&i, 'a', true)

But C++26 says that's ill-formed:

  Mandates: Each of the types type1, type2, and type3 is a cv-unqualified
signed
  or unsigned integer type.

Maybe that's OK, because if you include <stdckdint.h> in C++26 you should get
the C++ library's header, which should enforce the rules properly. If the C++
lib doesn't provide it yet, then you get the GCC ginclude/stdckdint.h one and
it isn't fully conforming.

But the fact it defines the __STDC_VERSION_STDCKDINT_H__ macro to the correct
value suggests it should be fully conforming.

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.


More information about the Gcc-bugs mailing list