]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb/build, c++20] Fix more deprecated implicit capture of this
authorTom de Vries <tdevries@suse.de>
Mon, 21 Oct 2024 06:04:07 +0000 (08:04 +0200)
committerTom de Vries <tdevries@suse.de>
Mon, 21 Oct 2024 06:04:07 +0000 (08:04 +0200)
commitced885161b6e1dee89acc4bd3b68ba7a27815645
tree7b650713fdc491af07b58188d66fb73e8469a716
parent0740c336853825b0cddce5dd10cbe26fd32693e7
[gdb/build, c++20] Fix more deprecated implicit capture of this

When building gdb with -std=c++20 I run into:
...
gdb/dwarf2/cooked-index.c: In lambda function:
gdb/dwarf2/cooked-index.c:471:47: error: implicit capture of ‘this’ via \
  ‘[=]’ is deprecated in C++20 [-Werror=deprecated]
  471 |   gdb::thread_pool::g_thread_pool->post_task ([=] ()
      |                                               ^
gdb/dwarf2/cooked-index.c:471:47: note: add explicit ‘this’ or ‘*this’ capture
...

Fix this and two more spots by removing the capture default, and explicitly
listing all captures.

Tested on x86_64-linux.
gdb/dwarf2/cooked-index.c
gdb/dwarf2/read.c