From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-40133.protonmail.ch (mail-40133.protonmail.ch [185.70.40.133]) by sourceware.org (Postfix) with ESMTPS id 59D65385800D for ; Tue, 28 Nov 2023 10:01:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 59D65385800D Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=protonmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 59D65385800D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=185.70.40.133 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701165669; cv=none; b=GhiDJDH8KeGHiT4+/fV3Jd7X//fBLFcTrg38r0LhHwzcnqc/tG9ChyFdyC/uTvtdatlVhZY+KU+OyRy+hgyA2xtO8yMA49Nh0gpm5dyhnRL7gzALIu2jA+y7VAwKGIcH7bN5ApcG9vwXMSw+Ga3D20AoB9kmJelYaG6GOxR3Z7E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701165669; c=relaxed/simple; bh=x/B+SexooxcduNSMhPVDxQNM9iDMuilqOj0Mg1S/oFw=; h=DKIM-Signature:Date:To:From:Subject:Message-ID:MIME-Version; b=k/Bt1eCBFE5lsUCt/Ka/kSCqpyGCdoa3EMRZj4mlS+nUBdUhGOMkDcgoL8JD18rh72D5o77ogN5L8JbGfCMhXj+KhqvEFr4jpRItpNvGTMVr2hv+AwS9BhMtIijU6zGKjXL5o8msh1mwqtcyQr3+xgC6BkGua02FmURtWvgKONI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1701165665; x=1701424865; bh=OSOeZUQCTej6V7BZfLS6XRdjGbuEMa/8n1jSJs8h9VA=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=A4nifSLTHG1qSstKwHqec06vegQOUnAieUu040G3dofUlCPwj6A9gaMxR5KPGVRp5 +e2e0sQx6T7s4DSBDcvdGZ/QpZIKJV+59avHt6EP/nts9vrsygT/g+ojscsrS7Sd7N G6n0S44wShQcDXKh1bwXC1R+JzKCkP2s2KzaULJ7VPUZ/g1z0CJmQV4wucnbmtnLzJ 8pmFXcYvyxrQ9YoRZAp7MnavASIMSMI8aT1t91/Bson3VRvjapLoe2hTM+LA2qSVDS B3iaivxDN4+ggtnRqGF5INClIVtdyPfl/sUhltv6ygl+OiKCLSSkahUdoR0/07ffc8 LKDSyycWKBOeQ== Date: Tue, 28 Nov 2023 10:00:54 +0000 To: waffl3x From: waffl3x Cc: Jason Merrill , "gcc-patches@gcc.gnu.org" Subject: Re: [PATCH v6 1/1] c++: Initial support for P0847R7 (Deducing This) [PR102609] Message-ID: In-Reply-To: References: <7Xr5Vil7ptZzPaCtc_ZCdcTPuUVY7dheOnklF-vVDb5_jl8PivYWgTT_f3cKLvg7IMnDruCDDrICRI6WVrUT3f8ZScGKAh4ATIkYSuRqPZc=@protonmail.com> <-SP7aKgN1FZED-RAPr2FBDuCrcwnu9-UhHcRXNEsNZRwIzJXCdhVbtBP921Yn8g71d0WL7XpFRetUlBAStzRpZB8p4yj5moRS0DIE9D6cnY=@protonmail.com> <7623e2db-ba29-42f2-85df-c2e796d7305b@redhat.com> Feedback-ID: 14591686:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS,TO_EQ_FM_DIRECT_MX,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: This fixes the const bug. I haven't bootstrapped and tested beyond my own tests yet but this does it. I don't know if this is the right way to fix this yet, but I think it's pretty close. I'll see if I can make a better write up tomorrow, but it seems to me that since we never cared about substituting captures at function template instantiation time there was never a special case added in here to add the const over to the var_decl's type. I assume in cases where there is some kind of type mismatch that it's usually handled before here, but this special case throws a wrench into the works. @@ -15402,6 +15450,8 @@ tsubst_decl (tree t, tree args, tsubst_flags_t comp= lain, gcc_checking_assert (TYPE_MAIN_VARIANT (TREE_TYPE (ve)) =3D=3D TYPE_MAIN_VARIANT (type)); SET_DECL_VALUE_EXPR (r, ve); + if (is_capture_proxy (t)) + type =3D TREE_TYPE (ve); } if (CP_DECL_THREAD_LOCAL_P (r) && !processing_template_decl) Sigh, that was really tough to track down, but it's honestly pretty relieving that it was MOSTLY using the closure type and not totally ignoring it. It just misses a step here for some reason, idk if this is a larger bug that was benign before, or if this case just invalidates some assumptions, I'm not really sure. I don't really have the energy to fully understand everything that's going on in here tonight. This fix is just good enough to bootstrap and run the tests overnight and hopefully when I check in the morning there won't be any regressions. Going to get some rest now, as long as the other maybe bugs I found are not related to xobj parameters we can probably dust off this patch this week. Although, maybe I should have learned by now that I'm terrible at estimating timelines. Alex