aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLancelot Six <lancelot.six@amd.com>2023-10-13 13:00:08 +0000
committerLancelot Six <lancelot.six@amd.com>2023-10-13 13:59:59 +0000
commitc98824eb67efc20b9747ccdd18d7b09b3f645ec8 (patch)
tree0b5a67c94bb620d6016a82a73c9d079b1d03821a
parent8ee751899736ad2495471c180221a12237c3ef1d (diff)
downloadgdb-users/lsix/try-require-c++17.zip
gdb-users/lsix/try-require-c++17.tar.gz
gdb-users/lsix/try-require-c++17.tar.bz2
gdb: Use initializers in lambda captures unconditionallyusers/lsix/try-require-c++17
Initializer in lambda captures were introduced in C++14, and conditionally used in gdb/cp-support.c and gdb/dwarf2/cooked-index.c. Since C++17 is now required by GDB, use this feature unconditionally. Change-Id: I87a3d567941e5c71217538fa75c952e4d421fa1d
-rw-r--r--gdb/cp-support.c8
-rw-r--r--gdb/dwarf2/cooked-index.c7
2 files changed, 2 insertions, 13 deletions
diff --git a/gdb/cp-support.c b/gdb/cp-support.c
index 579f093..882acfb 100644
--- a/gdb/cp-support.c
+++ b/gdb/cp-support.c
@@ -1658,13 +1658,7 @@ 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 ([
-#if __cplusplus >= 201402L
- =, copy = std::move (copy)
-#else
- =
-#endif
- ] ()
+ run_on_main_thread ([=, copy = std::move (copy)] ()
{
report_failed_demangle (copy.c_str (), core_dump_allowed,
crash_signal);
diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c
index 7c4af3a..10631dc 100644
--- a/gdb/dwarf2/cooked-index.c
+++ b/gdb/dwarf2/cooked-index.c
@@ -466,12 +466,7 @@ cooked_index::start_writing_index (dwarf2_per_bfd *per_bfd)
started, because it may call 'wait'. */
m_write_future
= gdb::thread_pool::g_thread_pool->post_task ([this, per_bfd,
-#if __cplusplus >= 201402L
- ctx = std::move (ctx)
-#else
- ctx
-#endif
- ] ()
+ ctx = std::move (ctx)] ()
{
maybe_write_index (per_bfd, ctx);
});