From e64cd55419b79018caf66043fb9db77aef0abb1d Mon Sep 17 00:00:00 2001 From: Tom de Vries Date: Sat, 24 May 2025 10:27:12 +0200 Subject: [PATCH] [gdb/build] Fix unused var in lookup_dwo_unit_in_dwp MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit On x86_64-linux, with gcc 7.5.0 I ran into a build breaker: ... gdb/dwarf2/read.c: In function ‘dwo_unit* lookup_dwo_unit_in_dwp()’: gdb/dwarf2/read.c:7403:22: error: unused variable ‘inserted’ \ [-Werror=unused-variable] auto [it, inserted] = dwo_unit_set.emplace (std::move (dwo_unit)); ^ ... Fix this by dropping the unused variable. Tested on x86_64-linux, by completing a build. --- gdb/dwarf2/read.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index c02b9cffbc0..273d594adfe 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -7400,7 +7400,7 @@ lookup_dwo_unit_in_dwp (dwarf2_per_bfd *per_bfd, std::lock_guard guard (dwp_file->loaded_cutus_lock); #endif - auto [it, inserted] = dwo_unit_set.emplace (std::move (dwo_unit)); + auto it = dwo_unit_set.emplace (std::move (dwo_unit)).first; return it->get (); } -- 2.47.2