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 748493858D1E for ; Thu, 19 Oct 2023 22:18:36 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 748493858D1E 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 748493858D1E 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=1697753917; cv=none; b=F86KFnGBNK+e1SJiCfkmnxOveq9RIgmFVawye0N3Ar8XO/lkTU6cKA5hz+EDf10R0C8/pMo9xw1I1tVEYO/UK/MgcDyzX9I+iODR1c1C6g3+knNTkDnwLNzL9uUzlv8m72Rg/6Fg1VjemAs6KS2szfra4sSeUKaG5igDvg8pHLU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697753917; c=relaxed/simple; bh=yIXYc+1++GjMOOqDA9smFy/zV4bS0oHbN7JnAnLzXUQ=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=lRU8ZsFBqUffagWPSXNVT2eGT6V1Xi1vKFKj0fH7Oe63SrtIF2BogCrn2/ztOdyFRVilJT8bDz8FZOjmPRqM9xcopEn8aVhKxUetZlnQ+/jj+9fLnu811yGZ/t3RNH6ihJUlUpLtrJ40jfw5FOvRoAqm6u9kWL7MwXAgg9ZmheI= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1697753916; 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=Wu5odOI7yWqeXKZjrSKyzRkWvzN8LeZvEkRaWlVE1jI=; b=MXZ2ItyTgEtHXfwZHUMs93Jm/JzUJhdcM/mIvWrcvA1Yx7X35c5XHFny7LeL40AmIdExu3 3cP789BQctOrwMhcZqD1Aoyj/4OwuGF9OeCXY9dkpbziwUVKHy24A7UuJTXHRNYXTEnbc5 CSEwXHoa4edH016jgzB2+dNMyMUYuD8= Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-528-5eEwEBjbO6K5_ZgJWQx_4g-1; Thu, 19 Oct 2023 18:18:34 -0400 X-MC-Unique: 5eEwEBjbO6K5_ZgJWQx_4g-1 Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-66d03b02d16so21125276d6.0 for ; Thu, 19 Oct 2023 15:18:34 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697753914; x=1698358714; 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=Wu5odOI7yWqeXKZjrSKyzRkWvzN8LeZvEkRaWlVE1jI=; b=UQP005hGnUItH3rWgPMcs34y2X6GJ9MoBCa+hfAZn2JtuB30cwBA61zcWzW4PNcUZv DYNOBCOI8FUqsP9cOAx4xbAVNH4/PC3Yl4XhuKDxPx3UgTEGP52eF2VoOW9NK5F/X9Oj 8xLhF2/QtTveaG64l/DXGMNY4KkpekPZQySVQcsaYp3cwxzQyZy+n0riX0snxCDiPpoJ rEGuu3IRx4JuSmV2aXS87NSYCECJsOXNCxdvtuY+5hVObaAoT6Gvj22n2P/hz70XYbIT tF/jWXPBrmBISeOnccebvqE4GwwPXs4HRZ5ceTSDDbSXAKXKpIXFaqyCm0auIhkfZQjy 1xxg== X-Gm-Message-State: AOJu0YygEe7K3we7c92tgyYfvcX8Z5smpVcMBmNt6VpoBXOBtHr5GEEA uNljBVtCCYpIFua+0xAks5333ZSqrXTDkbYdcIlfdrDgGHO+Ud3GKqDMumgf2ZN0vWeq0BXfX7H gunh9gF5+pfYOAqIy9w== X-Received: by 2002:a0c:eec7:0:b0:65a:f7b2:2057 with SMTP id h7-20020a0ceec7000000b0065af7b22057mr4526592qvs.24.1697753914433; Thu, 19 Oct 2023 15:18:34 -0700 (PDT) X-Google-Smtp-Source: AGHT+IER9dvSz8o6SxaT8HhmNcq3AXV1l38kHrLg1WKh0qmcx76jP+hWXrfPXCj7HTn+xTlVCHKFBw== X-Received: by 2002:a0c:eec7:0:b0:65a:f7b2:2057 with SMTP id h7-20020a0ceec7000000b0065af7b22057mr4526572qvs.24.1697753914092; Thu, 19 Oct 2023 15:18:34 -0700 (PDT) Received: from [192.168.1.108] (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 g20-20020ad457b4000000b0065d0dcc28e3sm186098qvx.73.2023.10.19.15.18.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Oct 2023 15:18:33 -0700 (PDT) Message-ID: Date: Thu, 19 Oct 2023 18:18:31 -0400 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: Jakub Jelinek , "gcc-patches@gcc.gnu.org" References: <2024d9f2-7560-eb9e-e9d9-de8769a06a8b@redhat.com> <0cc5b21d-4b27-4964-bec3-544c86307c74@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=-6.4 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,SPF_HELO_NONE,SPF_NONE,TXREP 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 10/19/23 17:05, waffl3x wrote: > Also, I'm not sure what %qs is, should I be using that instead of %s > for strings? The q prefix means quoted, with ' or other quotation marks, depending on the locale. > On another topic, I have been trying to fix taking pointers to explicit > object member functions today, as I ended up breaking that when I > started setting static_function to false for them. Originally it just > worked so I haven't touched any code related to this, but now that they > aren't being treating like static member functions as much so a few > things just broke. What I'm asking myself now is whether it would be > appropriate to just opt-in to static member function behavior for this > one, and I'm not sure that would be correct. > > So I started by checking what it did before I turned off the > static_function flag. It's was being passed into cp_build_addr_expr_1 > as a baselink node, while regular member functions are passed in as an > offset_ref node. I then checked what the case is for static member > function, and unsurprisingly those are also handled wrapped in a > baselink node, but this raised some questions for me. > > I am now trying to figure out what exactly a baselink is, and why it's > used for static member functions. My current best guess is that > method_type nodes already hold the information that a baselink does, > and that information is needed in general. If that is the case, it > might just be correct to just do the same thing for explicit object > member functions, but I wonder if there is more to it, but maybe there > isn't. It worked just fine before when the static_function was still > being set after all. > > Any insight on this is appreciated. A BASELINK expresses the result of name lookup for a member function, since we need to pass information about the name lookup context along to after overload resolution. An OFFSET_REF (with PTRMEM_OK_P) is used to express that we saw the &A::f syntax, so we could build a pointer to member if it resolves to an implicit-object member function. For an overload set containing only a single static member function, build_offset_ref doesn't bother to build an OFFSET_REF, but returns the BASELINK itself. I think we need the OFFSET_REF for an explicit-object member function because it expresses that the code satisfies the requirement "If the operand names an explicit object member function, the operand shall be a qualified-id." It might simplify things to remove the optimization in build_offset_ref so we get an OFFSET_REF even for a single static member function, and add support for that to cp_build_addr_expr_1. Jason