Don't use auto for lambda parameter
authorHannes Domani <ssbssa@yahoo.de>
Mon, 28 Nov 2022 18:32:43 +0000 (19:32 +0100)
committerHannes Domani <ssbssa@yahoo.de>
Mon, 28 Nov 2022 19:46:01 +0000 (20:46 +0100)
Older gcc versions (here 4.9.2) can't handle auto for a lambda parameter:

../../gdb/windows-nat.c: In member function 'void windows_nat_target::delete_thread(ptid_t, DWORD, bool)':
../../gdb/windows-nat.c:629:12: error: use of 'auto' in lambda parameter declaration only available with -std=c++1y or -std=gnu++1y [-Werror]
        [=] (auto &th)
            ^

gdb/windows-nat.c

index f61f6c1cb35c1176c1d15e657618964779634c41..6da6757acaf6220dacd65cdc1e39fc902e5d1013 100644 (file)
@@ -631,7 +631,7 @@ windows_nat_target::delete_thread (ptid_t ptid, DWORD exit_code,
 
   auto iter = std::find_if (windows_process.thread_list.begin (),
                            windows_process.thread_list.end (),
-                           [=] (auto &th)
+                           [=] (std::unique_ptr<windows_thread_info> &th)
                            {
                              return th->tid == id;
                            });