diff options
author | Enze Li <lienze2010@hotmail.com> | 2022-01-28 21:26:40 +0800 |
---|---|---|
committer | Enze Li <lienze2010@hotmail.com> | 2022-01-28 23:02:36 +0800 |
commit | 12735d34728d540ca39b8158da0ed1e257fa8f50 (patch) | |
tree | c0dbe8f1af31af4f83daa1e46800db7cc3914f49 /gdb/tui | |
parent | 459140adc0cbcf7ff5d389a195a3c9e34dd8282f (diff) | |
download | gdb-12735d34728d540ca39b8158da0ed1e257fa8f50.zip gdb-12735d34728d540ca39b8158da0ed1e257fa8f50.tar.gz gdb-12735d34728d540ca39b8158da0ed1e257fa8f50.tar.bz2 |
gdb/build: Fix Wpessimizing-move in clang build
When building with clang, I run into an error:
...
tui/tui-disasm.c:138:25: error: moving a temporary object prevents copy
elision [-Werror,-Wpessimizing-move]
tal.addr_string = std::move (gdb_dis_out.release ());
^
tui/tui-disasm.c:138:25: note: remove std::move call here
tal.addr_string = std::move (gdb_dis_out.release ());
^~~~~~~~~~~ ~
...
The error above is caused by the recent commit 5d10a2041eb8 ("gdb: add
string_file::release method").
Fix this by removing std::move.
Build on x86_64-linux with clang 13.0.0.
Diffstat (limited to 'gdb/tui')
-rw-r--r-- | gdb/tui/tui-disasm.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c index 445503a..70f7429 100644 --- a/gdb/tui/tui-disasm.c +++ b/gdb/tui/tui-disasm.c @@ -135,7 +135,7 @@ tui_disassemble (struct gdbarch *gdbarch, /* And capture the address the instruction is at. */ tal.addr = orig_pc; print_address (gdbarch, orig_pc, &gdb_dis_out); - tal.addr_string = std::move (gdb_dis_out.release ()); + tal.addr_string = gdb_dis_out.release (); if (addr_size != nullptr) { |