[PATCH] [gdb/build, c++20] Fix build with gcc 10

Tom de Vries tdevries@suse.de
Wed Jan 8 08:31:50 GMT 2025


On 1/7/25 16:05, Tom Tromey wrote:
>>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
> 
> Tom> -#if __cplusplus >= 202002L
> Tom> +#if __cplusplus >= 201709L
> 
> 201709 isn't one of the standard values, so I think an oddity like
> this should have a comment explaining where it came from.
> You can see the standard list here:
> 
> https://en.cppreference.com/w/cpp/preprocessor/replace
> 

Hi Tom,

thanks for the review.

I've added a comment here.

> Tom> -#if __cplusplus >= 202002L
> Tom> +#if __cpp_lib_polymorphic_allocator
> 
> If it's really undefined it would be clearer to use #ifdef.

Fixed in a v2 ( 
https://sourceware.org/pipermail/gdb-patches/2025-January/214541.html ).

I've also added "#if __has_include(<memory_resource>)" for the include, 
which fixes the build with gcc 8 and -std=c++2a.

Thanks,
- Tom



More information about the Gdb-patches mailing list