[gdb/build, c++20] Fix deprecated implicit capture of this

When building gdb with -std=c++20 I run into:
...
gdb/ada-lang.c:10713:16: error: implicit capture of ‘this’ via ‘[=]’ is \
  deprecated in C++20 [-Werror=deprecated]
10713 |   auto do_op = [=] (LONGEST x, LONGEST y)
      |                ^
gdb/ada-lang.c:10713:16: note: add explicit ‘this’ or ‘*this’ capture
...

Fix this by using "[this]".

Likewise in two more spots.

Tested on x86_64-linux.
This commit is contained in:
Tom de Vries
2023-08-17 10:41:34 +02:00
parent 63b87362a5
commit 5bd5fecdd2
3 changed files with 3 additions and 3 deletions

View File

@@ -10730,7 +10730,7 @@ ada_binop_addsub_operation::evaluate (struct type *expect_type,
value *arg1 = std::get<1> (m_storage)->evaluate_with_coercion (exp, noside);
value *arg2 = std::get<2> (m_storage)->evaluate_with_coercion (exp, noside);
auto do_op = [=] (LONGEST x, LONGEST y)
auto do_op = [this] (LONGEST x, LONGEST y)
{
if (std::get<0> (m_storage) == BINOP_ADD)
return x + y;