[2/4] Don't use auto for lambda parameter

Message ID 20221128191224.1411-2-ssbssa@yahoo.de
State Committed
Commit 23d04cffa847ab39e259ad262526f66d4fad1874
Headers
Series [1/4] Fix calling convention of thread entry point |

Commit Message

Hannes Domani Nov. 28, 2022, 7:12 p.m. UTC
  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 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Tom Tromey Nov. 28, 2022, 7:25 p.m. UTC | #1
>>>>> "Hannes" == Hannes Domani via Gdb-patches <gdb-patches@sourceware.org> writes:

Hannes> Older gcc versions (here 4.9.2) can't handle auto for a lambda parameter:

This is ok.  Thank you for the patch.

Tom
  

Patch

diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index f61f6c1cb35..6da6757acaf 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -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;
 			    });