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.
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;
(m_base_ptid) and the running thread, that may not have been included
to system.tasking.debug's list yet. */
- iterate_over_live_ada_tasks ([=] (struct ada_task_info *task)
+ iterate_over_live_ada_tasks ([this] (struct ada_task_info *task)
{
this->add_thread (task);
});
int found;
ULONGEST found_addr;
- auto read_memory = [=] (CORE_ADDR addr, gdb_byte *result, size_t len)
+ auto read_memory = [this] (CORE_ADDR addr, gdb_byte *result, size_t len)
{
return (target_read (this, TARGET_OBJECT_MEMORY, NULL, result, addr, len)
== len);