[PATCH] ginclude: Add comments about <stdalign.h> and <stdbool.h> in C++

Jason Merrill jason@redhat.com
Fri Sep 25 17:18:42 GMT 2026


On 9/25/26 12:29 PM, Jonathan Wakely wrote:
> The stdalign.h macros were removed from C++26 but this patch just tweaks
> the comment, without actually removing them. Doing so would be a
> breaking change, although probably not in practice because it seems very
> unlikely any C++ code is checking those macros.
> 
> The macros were also removed from C23, so if we remove them from
> stdalign.h for C then we can decide to do the same for C++ at that time.

While we're touching the comments, how about mentioning the C23 changes 
as well?

> gcc/ChangeLog:
> 
> 	* ginclude/stdalign.h: Note that the macros were removed from
> 	C++ in C++26.
> 	* ginclude/stdbool.h: Note that the macro is deprecated since
> 	C++23.
> ---
> 
> Tested x86_64-linux.
> 
> OK for trunk?
> 
>   gcc/ginclude/stdalign.h | 2 +-
>   gcc/ginclude/stdbool.h  | 1 +
>   2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/gcc/ginclude/stdalign.h b/gcc/ginclude/stdalign.h
> index a68cb28059ce..94ecbf14a417 100644
> --- a/gcc/ginclude/stdalign.h
> +++ b/gcc/ginclude/stdalign.h
> @@ -33,7 +33,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>   #define alignof _Alignof
>   #endif
>   
> -/* These are defined for C++, but deprecated in C++23.  */
> +/* These are defined for C++, but deprecated in C++23 and gone in C++26.  */
>   #define __alignas_is_defined 1
>   #define __alignof_is_defined 1
>   
> diff --git a/gcc/ginclude/stdbool.h b/gcc/ginclude/stdbool.h
> index 9070a1876233..6f72714f6d62 100644
> --- a/gcc/ginclude/stdbool.h
> +++ b/gcc/ginclude/stdbool.h
> @@ -46,6 +46,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
>   #endif /* __cplusplus */
>   
>   /* Signal that all the definitions are present.  */
> +/* This is defined for C++, but deprecated in C++23.  */
>   #define __bool_true_false_are_defined	1
>   
>   #endif	/* stdbool.h */



More information about the Libstdc++ mailing list