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 E84AE3858CD1 for ; Sun, 19 Nov 2023 21:44:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E84AE3858CD1 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 E84AE3858CD1 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=1700430289; cv=none; b=temUe0AO2/1Xx+sHh/ayPjH9oYqnYMu+M/Lje2I2NrpgrN1jb9mC0F/E4bfxK45mcjd9Bz0R+kcRjvcU6Ah2L7O8VPgao9ezkxSHRa4hhetGjcmaVSGfNVQVUjdFtb1K7DIsZPyfB9Ae/PcBy/jwJ3iKoDhu3gTucye6CuCm/t8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700430289; c=relaxed/simple; bh=73mQjlejydIJlSA45GJgFFnNgjsaeOhQ6zfWaKMMXYY=; h=DKIM-Signature:Date:To:From:Subject:Message-ID:MIME-Version; b=S8pkJ5jVvemJRYaPoHok6DfXAXtVA4S1khJGKnROzypmtQoBIbxqEbvhtcJTanykUKQDlkq9y6YmUW6e2miwdvWFL6qLnf4Wif0iNkyU9Pu3Kx5x6ypkthgY7FXU2UatnL2+oiKApeGesUm6nrRjoUkfyPUT0BP/dJhZnmETSow= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1700430286; x=1700689486; bh=73mQjlejydIJlSA45GJgFFnNgjsaeOhQ6zfWaKMMXYY=; 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=f17cE9iUGy9t24Oo3lt743HVnLUmC2QqbUXu6JEsoOkXUdsph6w/5OkgOwfqs43GW 8BQAe/PhWWU5WEZV5RkNSfWc0UYpJjXLhv7KYnZIVlMkE0GlaRe4QpqfxY1LKji4dn 1x1nj3jEiarSB5zvi0yzRdfcHMXyN3oOIOdjMLFAhSZMbqYWz9Olu0RhmDT/W/PVjO PE/Woq45lhtyxysNzd6jevrWlYs2Y2xAVwETLvo9V/CWfZKb0k7sGqeXNF4auuqNgz 1Io3MyNiMzwxvEkIp4S58O0Uvbe+w5jNFJz2q/K53IujIumZ2PD2BpkzLcB1AdGkpK 3C3rWGSNlblaA== Date: Sun, 19 Nov 2023 21:44:42 +0000 To: Jason Merrill From: waffl3x Cc: "gcc-patches@gcc.gnu.org" Subject: Re: [PATCH v3 1/2] c++: Initial support for P0847R7 (Deducing This) [PR102609] Message-ID: In-Reply-To: <9890a007-755e-41e2-bc33-37ebf0755435@redhat.com> References: <9890a007-755e-41e2-bc33-37ebf0755435@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.4 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: On Sunday, November 19th, 2023 at 1:34 PM, Jason Merrill = wrote: >=20 >=20 > On 11/19/23 13:36, waffl3x wrote: >=20 > > I'm having trouble fixing the error for this case, the control flow > > when the functions are overloaded is much more complex. > >=20 > > struct S { > > void f(this S&) {} > > void f(this S&, int) > >=20 > > void g() { > > void (*fp)(S&) =3D &f; > > } > > }; > >=20 > > This seemed to have fixed the non overloaded case, but I'm also not > > very happy with it, it feels kind of icky. Especially since the expr's > > location isn't available here, although, it just occurred to me that > > the expr's location is probably stored in the node. > >=20 > > typeck.cc:cp_build_addr_expr_1 > > ``` > > case BASELINK: > > arg =3D BASELINK_FUNCTIONS (arg); > > if (DECL_XOBJ_MEMBER_FUNC_P ( > > { > > error ("You must qualify taking address of xobj member functions"); > > return error_mark_node; > > } >=20 >=20 > The loc variable was set earlier in the function, you can use that. Will do. > The overloaded case we want to handle here in > resolve_address_of_overloaded_function: >=20 > > if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn) > > && !(complain & tf_ptrmem_ok) && !flag_ms_extensions) > > { > > static int explained; > >=20 > > if (!(complain & tf_error)) > > return error_mark_node; > >=20 > > auto_diagnostic_group d; > > if (permerror (input_location, "assuming pointer to member %qD", fn) > > && !explained) > > { > > inform (input_location, "(a pointer to member can only be " > > "formed with %<&%E%>)", fn); > > explained =3D 1; > > } > > } >=20 >=20 > Jason I'll check that out now, I just mostly finished the first lambda crash. What is the proper way to error out of instantiate_body? What I have right now is just not recursing down further if theres a problem. Also, I'm starting to wonder if I should actually be erroring in instantiate_decl instead. I guess it will be better to just finish and you can share your comments upon review though. Alex