diff options
author | Tom de Vries <tdevries@suse.de> | 2023-08-17 10:41:34 +0200 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2023-08-17 10:41:34 +0200 |
commit | 5bd5fecdd25eda1335796df8d77511f62bbd1898 (patch) | |
tree | 627442c62463ac83011a6b6489449536813699cd /gdb/ada-lang.c | |
parent | 63b87362a5800890ccc5ca8494a9e0443472ef99 (diff) | |
download | binutils-5bd5fecdd25eda1335796df8d77511f62bbd1898.zip binutils-5bd5fecdd25eda1335796df8d77511f62bbd1898.tar.gz binutils-5bd5fecdd25eda1335796df8d77511f62bbd1898.tar.bz2 |
[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.
Diffstat (limited to 'gdb/ada-lang.c')
-rw-r--r-- | gdb/ada-lang.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 2f934b1..575568c 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -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; |