From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.freebsd.org (mx2.freebsd.org [96.47.72.81]) by sourceware.org (Postfix) with ESMTPS id 0E40438582B0 for ; Mon, 7 Aug 2023 18:01:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0E40438582B0 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=FreeBSD.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits)) (Client CN "mx1.freebsd.org", Issuer "R3" (verified OK)) by mx2.freebsd.org (Postfix) with ESMTPS id 4RKPJX5byXz3Dc1; Mon, 7 Aug 2023 18:01:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4RKPJX2zXSz3Kfs; Mon, 7 Aug 2023 18:01:16 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691431276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BGxPpBh54Y6KTIaJw4cBjRefOZd/Zcpe1SNpmULxJ9Q=; b=ijZE1VqkJJvKRXBMPTTl2uPH/1MTv4TGZbaGoZnQBd562eecHnJD3WqrrocENtQux+uiPG W9B8QEQKBggoCRciQt7JxfAHBjsf97Qe7EeNWDNXtLmbbUS1EMcVYajo3OG0VGzaeI70DY BnGwFTxNGzt8hGRB02x+9IXhKyq6YYSGWez0Ravrf1TozN2KX5ZuS9J0r1v2Ee4VSnXoaE yfIgbS8l35wKkvq6D8SHq3E0ZD1+wDQSySJKRt1Z6r7ObOeqUz2acEWxmr4Vo/4qZZQTXa Trjmq6ZV/N2e0Mhaecdswocl6rm3G7fUuEWDLGlpKrWSfJsvRwbaeXszYOFNUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1691431276; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BGxPpBh54Y6KTIaJw4cBjRefOZd/Zcpe1SNpmULxJ9Q=; b=v+x/X6VtgzvcyEffd+ZHYEZgWnv+AQCSCnUpdR/chMiPXGti9OUcnM0rleBMq1Xw72ILGl LUunrDc931alz6X+6CQCcnD2/oEt1jotKU5LpP77NT7FP1yymV399qrcwrvHf/7gas/Amh tZkDluNgFPaF1WiSu5CMWrx8slvYs/a457uc24Gh8QcAjt/PNcTuZjMRa15UBmRO9/gxjX r6kpn1RG1/HeG1FDcDu0CxUHbIPaWzTgidR/L211pbnnQ+yqkdygg7Z8KnuNcIlqyfGAeM TICbz5tL3YzZvI6mUii15LMpb1tkb1Dt+b4snAC94XHo+nAfixtOhgnroFLyqQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1691431276; a=rsa-sha256; cv=none; b=cMMC2ImMmnD92aS79F2htMdJgXgJ9p6pTP8zNAywouzB0ZfH/KlI7bOnMfbU/HFL6o6wd4 MA0GZH2wOMam82A+vsvYCAJv+eJfVSfMynwYTaqxwlD8qmHo4+rJZ52TXN5CG2+8XFhISO GBip4GJy6XKORp4LfMXhIMJq7IAhdJuFK+sylWNzd6D6ao0Xuq7AF4zm1FitKawheptPfk q7uCEMSXa8/UGEYmNtw0l9FM3BvC+9dEQNVPitGJf0Z0kyRzQrVozMjoAFUGHxfZ99j/Tr 3OVTkgDYNyO59a2rEqZRe6G3Tnr8HuophiCPbK/8u3FbSES4e6/OWl5tiTOyMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from [IPV6:2601:648:8683:a9e0:78da:f71f:8267:93ba] (unknown [IPv6:2601:648:8683:a9e0:78da:f71f:8267:93ba]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4RKPJW643Kz1Djl; Mon, 7 Aug 2023 18:01:15 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <21fba7d9-3f98-9ecd-2eb6-b574c23fd5db@FreeBSD.org> Date: Mon, 7 Aug 2023 11:01:14 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: [PATCH] [gdb/build] Fix build breaker with -std=c++11 Content-Language: en-US To: Tom de Vries , Simon Marchi , Tom de Vries via Gdb-patches Cc: Tom Tromey References: <20230806235915.18746-1-tdevries@suse.de> <51561E9D-24F0-48CB-A563-50F29C2966D9@polymtl.ca> <6682f2e5-f6ab-7b54-ba95-a60c217b6c86@suse.de> From: John Baldwin In-Reply-To: <6682f2e5-f6ab-7b54-ba95-a60c217b6c86@suse.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,NICE_REPLY_A,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: On 8/7/23 10:15 AM, Tom de Vries via Gdb-patches wrote: > On 8/7/23 16:35, Simon Marchi wrote: >> >> >> On August 6, 2023 7:59:15 p.m. EDT, Tom de Vries via Gdb-patches wrote: >>> 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 >> >> When we encounter things like this, should we add some greppable TODO comment to record an actionable item for when we switch to a more recent C++ version? > > Hi Simon, > > thanks for the review. > > Fine by me, added comment. An alternative that is slightly more work but might be nicer long term would be to #if on the C++ version, so for example: #if __cplusplus >= 201402L = gdb::thread_pool::g_thread_pool->post_task ([this, per_bfd, ctx = std::move (ctx)] () #else = gdb::thread_pool::g_thread_pool->post_task ([this, per_bfd, ctx]) () #endif -- John Baldwin