mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 09:08:59 +00:00
[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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user