From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-4322.protonmail.ch (mail-4322.protonmail.ch [185.70.43.22]) by sourceware.org (Postfix) with ESMTPS id 7C02A3858D33 for ; Tue, 5 Dec 2023 04:36:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 7C02A3858D33 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 7C02A3858D33 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=185.70.43.22 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701750975; cv=none; b=nWlZCXYJuiDSTpDb5EBqAQ9ufeLP5Dq3kwUDI8HB4PadSG+s2DqzGzkl3BLRosBIgxEbn0O/UofLuiuEKde3hsfq+VVRXIrPB1WXove9QMLHB/Kp1iMsVXm1xICJ6B4TDuPys1Oz5Mil3yv7CsBX6BxQbbf8m6VBbPBSSP5yw5Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701750975; c=relaxed/simple; bh=Czoa6r0623k9Jv+MS+kQreW3Oa0zhrRAsh6J32vSmaQ=; h=DKIM-Signature:Date:To:From:Subject:Message-ID:MIME-Version; b=a/sKiKYhQ3nJa6mNbu6NUp9biookTfwliSr24/FzmpgrpYbOnxn1L78k44uNgxkec5vcBP2Y3bOOoBDzD+4MGSa8+1fM6zYjSUsYJeEZ04XWsiTN6ZvMQbUub0Tcl7FCaX2GVhq5fbRYEEvhPHeqVM3aP6gEpGtP3wLzFLDxh3w= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1701750964; x=1702010164; bh=bxB8eTAIdabZMReWPqRhhMLmC4TcQQ7WbT9pAMA0a7I=; 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=QFB6BD6U9l3rXq9s41TLPA61jYrepOJC2UFOPuSMDOnOkxGoBylvzAfPhlLc86GYy v5BKvfq8/PevFhCwoib3lmYjRBfbbk+Iwb0Y/pBDc9gkFAFx1f2HhVzIsz6uPa5b3N ejSTtEtpo7zQ3FMA1qE5f91vnUdt363Mnv1t2MWJroiM71b/CKhzJ2eWkZMX3yQFKK V61BVQSqP22sN5Ztj0+BgfLtOMd3fS1b0sW/p1TI/B1KkXg6IrW60XK0l/0bmg7vsr XK+Z4Kn+FB9cwXYKpiVjBkMb4OVHzzpZgfh2xBmQSYAgKJocqU/Bw5DYNXwm7M8gMQ 1MhSng0ml+BLw== Date: Tue, 05 Dec 2023 04:35:51 +0000 To: Jason Merrill From: waffl3x Cc: "gcc-patches@gcc.gnu.org" Subject: Re: [PATCH v6 1/1] c++: Initial support for P0847R7 (Deducing This) [PR102609] Message-ID: In-Reply-To: <575c0bbe-a3d6-4a54-b299-edff64df84b1@redhat.com> References: <_e1O52EjoN_BFiH31iHE-0eYegNJhoOdDN2O0mduqtMmt7qTGpRWgduxNppnO1si01rORJ470oWcoM-_lk1ICFo9lhe_ylBKQsJ791qMm_k=@protonmail.com> <1b3b0259-5ce4-4193-a36d-60f09e1c7c92@redhat.com> <575c0bbe-a3d6-4a54-b299-edff64df84b1@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=-3.0 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,TXREP,T_SCC_BODY_TEXT_LINE 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: >> @@ -15402,6 +15450,8 @@ tsubst_decl (tree t, tree args, tsubst_flags_t c= omplain, >> 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); >That should have close to the same effect as the lambda_proxy_type >adjustment I was talking about, since that function basically returns >the TREE_TYPE of the COMPONENT_REF. But the underlying problem is that >finish_non_static_data_member assumes that 'object' is '*this', for >which you can trust the cv-quals; for auto&&, you can't. >capture_decltype has the same problem. I'm attaching a patch to address >this in both places. Regarding this, was my change actually okay, and was your change supposed to address it? I applied my patch to the latest commit in master yesterday and started tests and whatnot with this change commented out as I wasn't sure. It seems like my tests for constness of captures no longer works with or without this change commented out. If you wish I can go over everything again and figure out a new solution with your changes but stepping through all this code was quite a task that I'm weary of doing again. Even if the second time through won't be so arduous I would like to avoid it. You know what, I'll give it a go anyway but I don't want to spend too much time on it, I still have a few tests to clean up and this crash to fix. template void f() { int i; [=3D](this T&& self){ return i; }(); // error, unrelated } int main() { f(); } If this crash doesn't take too long (I don't think it will, it seems straightforward enough) then I'll look at fixing the captures with a const xobject parameter bug the correct way. Alex