[0/7] More C++17 Updates

Message ID 20231016230527.1820819-1-tom@tromey.com
Headers
Series More C++17 Updates |

Message

Tom Tromey Oct. 16, 2023, 11:02 p.m. UTC
  This series is based on Lancelot's C++17 series.  I found some more
spots in gdb that could easily take advantage of C++17.

I'm sure there are some more spots to be found.  For example, I
suspect try_embed can be used in more places than the one that was
commented as such.

I have another branch where I try to replace gdb::array_view with a
C++20-compatible std::span.  However, this one is a bit more invasive,
so I thought I would leave it for a little later.  Note that gdb
doesn't currently build cleanly in C++20 mode (mostly but IIRC not
entirely due to the use of 'volatile' in the Guile headers).

Regression tested on x86-64 Fedora 38.

Let me know what you think.

Tom
  

Comments

Pedro Alves Oct. 17, 2023, 9:06 a.m. UTC | #1
On 2023-10-17 00:02, Tom Tromey wrote:
> This series is based on Lancelot's C++17 series.  I found some more
> spots in gdb that could easily take advantage of C++17.
> 
> I'm sure there are some more spots to be found.  For example, I
> suspect try_embed can be used in more places than the one that was
> commented as such.

I guess you mean try_emplace.

> 
> I have another branch where I try to replace gdb::array_view with a
> C++20-compatible std::span.  However, this one is a bit more invasive,
> so I thought I would leave it for a little later.  

I wish that C++ had went the array_view route, but oh well.

> Note that gdb
> doesn't currently build cleanly in C++20 mode (mostly but IIRC not
> entirely due to the use of 'volatile' in the Guile headers).
> 
> Regression tested on x86-64 Fedora 38.
> 
> Let me know what you think.

Other than the comment on the try_emplace patch, this all LGTM:

  Approved-By: Pedro Alves <pedro@palves.net>
  
Tom Tromey Oct. 19, 2023, 8:26 p.m. UTC | #2
>> Let me know what you think.

Pedro> Other than the comment on the try_emplace patch, this all LGTM:

Pedro>   Approved-By: Pedro Alves <pedro@palves.net>

Thanks.

I added one more patch that I'll send in v2: I realized we can remove
gdb_static_assert now.

Tom