From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id F39E5385800C for ; Sun, 19 Nov 2023 20:34:33 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org F39E5385800C Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org F39E5385800C Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700426075; cv=none; b=HNLdsFjA+DMY+ls9ZH+wQiO/VoBEv+AlY6sA2GcRjweI+1dUTM613VfxSOTPYk5FJhnKoMs7TZD/gxOiTNgwUc9yZQ9KOsd6GDMo/e8kuhyCacENPt6IGUVoK0++aD0amcfnOVVQUeVnkfz4wKTVV4oN8fuSQ62UahteqvXWI24= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700426075; c=relaxed/simple; bh=LsaKEHvbDkjP2/gbVUAsJsEW4y1zL90VVa7fvbaUla0=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=sadBgZZ0E3tl6n1E7lwucOC190AHrk1J+IJXPZh4e6iATZ046hAyJb3jgYnsM5jOPqdYLgN/M1Vp9lEXbaW3SE8zAtxtccX6B7L2oM4i/YEpJoVSDW4V4WEv23zfev8YBC8bRczPE075GdCg8vLst4fenmbbFTs+ajRmHq7EkJk= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700426073; 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=5OcFKprZ5Ke6IjxM1JYA05yC3vZK2Sb40IInC2GcnNs=; b=CiL26WX4Xb3xXUcOsqb5A40YDIy132EFGUZYkLsxJ+RVDVWZp1wCJJFTHbnv5EhFtxkGcZ FKgQOqXRI2OJxGgzCUKZBhMmT1jMKkuOiikMpjZKY+h7SEc3vsvKoImRjfuU8nxIFY5mdT X7ykaXl0622marnbONU3PRlPunHEQpg= Received: from mail-vs1-f72.google.com (mail-vs1-f72.google.com [209.85.217.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-101-_WeC8Oe1NDOMuD6opBAbPQ-1; Sun, 19 Nov 2023 15:34:31 -0500 X-MC-Unique: _WeC8Oe1NDOMuD6opBAbPQ-1 Received: by mail-vs1-f72.google.com with SMTP id ada2fe7eead31-46284dd9892so582034137.1 for ; Sun, 19 Nov 2023 12:34:31 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700426070; x=1701030870; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=5OcFKprZ5Ke6IjxM1JYA05yC3vZK2Sb40IInC2GcnNs=; b=LoQhKukor8ddVnnFqvBDhd0Yg6me3Z5q+2ep5eFRjnC6Q7YVjPYf5r6bRX3NM/QwMW pZHVFsTwoGr8fOCo9DcrGAp8YyNYwIGCfgp5uRzfnCW4mFZ3G3yfyvhJ1Omikjq0FSEx h+Kj/FI4OmIXSouZwTsX2BUKSOR8FJiAEHegNc49uLRoZez63WrI0Q7TLB3oSbBpJHqf YirW3fDcYQ5Llp/ONhrc6Wj+/Hl5d0Lunu355EqmoxU+1/3wnj96PZdK6IQ+UGehmktx tIju2OpDF/aGPnUR2rlYtDyveMEJojRwMG8o3sydWmgSBRSP3mtaltCW3hyDXXFcWr4m fS2g== X-Gm-Message-State: AOJu0YwMirwE3J0ANY8lem5I7Kv57wRkLn+1jeUUTACSbuMst9PJwGC0 jYZZ2/Rxe8ovpYyNAbgKnW+oZsf6k9yVbEUOgm/Yf3FnXpDQbCzjP3XJa4hFaF2bHARuHTEZqcu lWzaPKqb6BMYoGQZo7g== X-Received: by 2002:a05:6102:104c:b0:462:7604:3d6b with SMTP id h12-20020a056102104c00b0046276043d6bmr4983069vsq.17.1700426070592; Sun, 19 Nov 2023 12:34:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGo+RMaLQCdwmld4wv1i9mKkd77+KIOIYY7t1Wqpc4u1LzTKzcEb0NwZQPYsGFZRI/aq4F10Q== X-Received: by 2002:a05:6102:104c:b0:462:7604:3d6b with SMTP id h12-20020a056102104c00b0046276043d6bmr4983062vsq.17.1700426070338; Sun, 19 Nov 2023 12:34:30 -0800 (PST) Received: from [192.168.1.145] (130-44-146-16.s12558.c3-0.arl-cbr1.sbo-arl.ma.cable.rcncustomer.com. [130.44.146.16]) by smtp.gmail.com with ESMTPSA id ct2-20020a056214178200b0065b0d9b4ee7sm2345821qvb.20.2023.11.19.12.34.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 19 Nov 2023 12:34:29 -0800 (PST) Message-ID: <9890a007-755e-41e2-bc33-37ebf0755435@redhat.com> Date: Sun, 19 Nov 2023 15:34:28 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 1/2] c++: Initial support for P0847R7 (Deducing This) [PR102609] To: waffl3x Cc: "gcc-patches@gcc.gnu.org" References: From: Jason Merrill In-Reply-To: X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-6.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,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 11/19/23 13:36, waffl3x wrote: > I'm having trouble fixing the error for this case, the control flow > when the functions are overloaded is much more complex. > > struct S { > void f(this S&) {} > void f(this S&, int) > > void g() { > void (*fp)(S&) = &f; > } > }; > > 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. > > typeck.cc:cp_build_addr_expr_1 > ``` > case BASELINK: > arg = BASELINK_FUNCTIONS (arg); > if (DECL_XOBJ_MEMBER_FUNC_P ( > { > error ("You must qualify taking address of xobj member functions"); > return error_mark_node; > } The loc variable was set earlier in the function, you can use that. The overloaded case we want to handle here in resolve_address_of_overloaded_function: > if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn) > && !(complain & tf_ptrmem_ok) && !flag_ms_extensions) > { > static int explained; > > if (!(complain & tf_error)) > return error_mark_node; > > 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 = 1; > } > } Jason