]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
gdb: Use initializers in lambda captures unconditionally users/lsix/try-require-c++17
authorLancelot Six <lancelot.six@amd.com>
Fri, 13 Oct 2023 13:00:08 +0000 (13:00 +0000)
committerLancelot Six <lancelot.six@amd.com>
Fri, 13 Oct 2023 13:59:59 +0000 (13:59 +0000)
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

gdb/cp-support.c
gdb/dwarf2/cooked-index.c

index 579f09303c8713ff081ee89e30b1ea5a32e38d09..882acfb62a2d1afa65c5294611d977cb79228dfb 100644 (file)
@@ -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);
index 7c4af3a168186cd957c848eae1e4309504403343..10631dccecf79bd3843793e1fd331caf594ca781 100644 (file)
@@ -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);
        });