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.133.124]) by sourceware.org (Postfix) with ESMTPS id 3907F3858C54 for ; Mon, 20 Nov 2023 14:35:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3907F3858C54 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 3907F3858C54 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700490933; cv=none; b=HAggurWYNeHPebPQPDhmPxkM4MgKO66F8Zcf+9MPKYcgoXt3T+SSoNjqZ3kD4JC4gCBdwT9RKNOVQbBzIFUA4IyvPwSGojLRg6p0b2HvCrFbcYHyXPlvxK/QEWMF6VjpP0bj/V0Bh0cP1+Ml1Gk1E+3eOzZQHJ78q/Gzs4Y8B0Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700490933; c=relaxed/simple; bh=L2YOPly3X/2rk61u/S69j230P2zW6Yka581xPg2FOR4=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=oD9GBP/w1r3A7IVB0XWuJa5axgeoLt1qvKkbgBjbBnSlPNatF3wPmq/Vg8m1GGMj/pxqF58gvqFXjF1bGGeHJmcc9UulMHgbETgXTs6Z65IcHc+yUbXjucdILq4KvzAoOGQ4c5jJGuwxQ3LxboUuK2ddGb0XeXge0PCfR6495fc= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1700490931; 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=GhBb3xVfJlP2QV8arPChlEp5yQvJsq/78NEWEiwnDOg=; b=ADIg+Nug2uK406Rl22h+OvNwTXwwZ8bH56Rqah4dlH3GnXNnQTxIVjmPYa4+1n0b2s8Izr Br35MnnrAhpqSjVqwbswFwtl630j2Gdvr44WMco99uKvMuRYZ9Hvqmd7Qgsx949/XZqyep BMpIaUg2suhdRDztgnZSYxjhzjlK68Q= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-644-lANXG3ZTMD2RU994Imi6-Q-1; Mon, 20 Nov 2023 09:35:30 -0500 X-MC-Unique: lANXG3ZTMD2RU994Imi6-Q-1 Received: by mail-qk1-f199.google.com with SMTP id af79cd13be357-77bc8a94064so564239685a.0 for ; Mon, 20 Nov 2023 06:35:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700490930; x=1701095730; 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=GhBb3xVfJlP2QV8arPChlEp5yQvJsq/78NEWEiwnDOg=; b=Xw/0Nz3Mm+TgFkUZ0j/gNRAttfT9lxpP8KtlTpWttpCwb+cwIX2O0ZRuYIq0JoNq5l kmwFjsSc5fsRIcciHd9SUtv9+hHmJlf4kI8y2irQovznGMckCs026QsJ1Tms0IChs/uC e93oQVtVuGPndqH8/SaVaHQRo1EwIsZbKbICc1wmyFstzb/sQAq8pCirXgw+qWnrfqBK 8Sa7tG1Nh6hUOAKpcTI34K9pZtUuGp291iT08sqf8zSC1l2OI1rDgiueyjWQvmidt2nR K8+MzK/ivyBPBN0nMuRgtXXFinzbNWWu8kSTcE+N58t6HBKruGCeY/IsdbWi0yMKamiJ fJOg== X-Gm-Message-State: AOJu0Yw25WsWD9Q1g0oq6lUBtseJmQGww+DkrpArYBcIgeXcZXegHozt Ap3/NCnSntNMHIyP1wr8djJ8uKXhOeSLvLJuHWAC1F2Caym3pBuX9eKm/GpX3xNmgou9PZ3QpG3 HMWFQkLrRbCkhXfASswEXnZJQpg== X-Received: by 2002:a05:620a:8805:b0:77b:d563:1c07 with SMTP id qj5-20020a05620a880500b0077bd5631c07mr8109451qkn.78.1700490930027; Mon, 20 Nov 2023 06:35:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IFor/FsBlwBMe/KDxxJQrgDlxvWwl/vzcThSCgZ8QGEPAvjpPptLdsLV7PZz3R6NKLGz1dUBw== X-Received: by 2002:a05:620a:8805:b0:77b:d563:1c07 with SMTP id qj5-20020a05620a880500b0077bd5631c07mr8109433qkn.78.1700490929712; Mon, 20 Nov 2023 06:35:29 -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 c22-20020ae9e216000000b0076dacd14484sm2699347qkc.83.2023.11.20.06.35.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Nov 2023 06:35:28 -0800 (PST) Message-ID: Date: Mon, 20 Nov 2023 09:35:27 -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: <9890a007-755e-41e2-bc33-37ebf0755435@redhat.com> 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=-5.3 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_H3,RCVD_IN_MSPIKE_WL,RCVD_IN_SORBS_WEB,SPF_HELO_NONE,SPF_NONE,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: On 11/19/23 16:44, waffl3x wrote: > > > > > > On Sunday, November 19th, 2023 at 1:34 PM, Jason Merrill wrote: > > >> >> >> 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. > > Will do. > >> 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 > > 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 think you want to error in start_preparsed_function, to handle template and non-template cases in the same place. Jason