From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 809AB3858C2D for ; Sun, 6 Aug 2023 23:59:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 809AB3858C2D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 6A8351F899; Sun, 6 Aug 2023 23:59:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1691366363; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TGLQ7G3xVuk97Fa/K0orlgP//lyJaEB3LM6jmu8WBoo=; b=FKeTBqQCYwMVJtrobLflgIB5zXIsx8tXkzegakuedabcWzKkxkglmmlk5BMOxM6X4JE3uj +AGO+1uvOxtfLAIrsO5tgzzXLsuYiYiZRMIxUl/3KxcGOuHb8GMyVK8YARAds9imAYH2GC JdrMjcn4HubIyl60HcXGMjj8+ig0cS8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1691366363; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TGLQ7G3xVuk97Fa/K0orlgP//lyJaEB3LM6jmu8WBoo=; b=hpyVFBXzXFiQSxhk9TkxN1E9qbdf6jOl01LNZDsyqg4YdAQzBx6T6sVRoftoW7IFyG701d wPiXJWR7ZXuMzEBg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 518E913454; Sun, 6 Aug 2023 23:59:23 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id EAXMEtsz0GTiQAAAMHmgww (envelope-from ); Sun, 06 Aug 2023 23:59:23 +0000 From: Tom de Vries To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [PATCH] [gdb/build] Fix build breaker with -std=c++11 Date: Mon, 7 Aug 2023 01:59:15 +0200 Message-Id: <20230806235915.18746-1-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: When building with -std=c++11 I run into: ... gdb/dwarf2/cooked-index.c: In member function \ ‘void cooked_index::start_writing_index(dwarf2_per_bfd*)’: gdb/dwarf2/cooked-index.c:469:10: error: lambda capture initializers only \ available with -std=c++14 or -std=gnu++14 [-Werror] ctx = std::move (ctx)] () ^~~ ... Fix this by capturing a copy instead: ... = gdb::thread_pool::g_thread_pool->post_task ([this, per_bfd, ctx] () ... Tested on x86_64-linux. Reported-By: Tom Tromey --- gdb/dwarf2/cooked-index.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gdb/dwarf2/cooked-index.c b/gdb/dwarf2/cooked-index.c index df82e86b690..87aac5aaa8b 100644 --- a/gdb/dwarf2/cooked-index.c +++ b/gdb/dwarf2/cooked-index.c @@ -465,8 +465,7 @@ cooked_index::start_writing_index (dwarf2_per_bfd *per_bfd) /* This must be set after all the finalization tasks have been started, because it may call 'wait'. */ m_write_future - = gdb::thread_pool::g_thread_pool->post_task ([this, per_bfd, - ctx = std::move (ctx)] () + = gdb::thread_pool::g_thread_pool->post_task ([this, per_bfd, ctx] () { maybe_write_index (per_bfd, ctx); }); base-commit: 5e66f55c62e306afbcc93856bf06e542ddd00997 -- 2.35.3