mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-27 12:03:41 +08:00
[gdb/build] Use move capture in gdb_demangle
Use move capture in gdb_demangle when compiling for c++14 or higher, to save a std::string copy. Tested on x86_64-linux. Reported-By: Tom Tromey <tom@tromey.com> Approved-By: Tom Tromey <tom@tromey.com>
This commit is contained in:
parent
e3b6618719
commit
7570a17cbb
@ -1656,7 +1656,13 @@ gdb_demangle (const char *name, int options)
|
||||
we might be in a background thread. Instead, arrange for
|
||||
the reporting to happen on the main thread. */
|
||||
std::string copy = name;
|
||||
run_on_main_thread ([=] ()
|
||||
run_on_main_thread ([
|
||||
#if __cplusplus >= 201402L
|
||||
=, copy = std::move (copy)
|
||||
#else
|
||||
=
|
||||
#endif
|
||||
] ()
|
||||
{
|
||||
report_failed_demangle (copy.c_str (), core_dump_allowed,
|
||||
crash_signal);
|
||||
|
Loading…
Reference in New Issue
Block a user