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 5FBCB3858C2C for ; Fri, 1 Dec 2023 16:52:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5FBCB3858C2C 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 5FBCB3858C2C 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=1701449529; cv=none; b=cmHMowk3g7YIe2k1ljjYYfdWQcXFJbjq/Cc036CK9tn/2p00q3fxPUvXz1x4lvme0NWHMaxCKIrwLGgHCq10sMNhCURQq+pme7fkiV57n4UOBH6XugEePmJV1qXrQ89MpZmpgikubHrm0e7Ehb456F9uK3weiloEjAYYaj7qgSI= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1701449529; c=relaxed/simple; bh=TTklhVLjyF1Ku88v5OhPKtHUyoBZsmMrv0dcck0O9vg=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=uSgsYGVwTURmWCPXM/NQl3IjT7HQyf4KvFkzk3x6jsaz8VgSQoaweVkdllA0j8EP5K1yBTPchSPF+B//LaBfx6L/zQlAvysOlx9msiSJX+lKQbXdKq4WVqkCkml7W95x2wuwtNMoiKsxh6uzC7Fe1OzyGOzE92bHBP6rCFdNSMw= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701449528; 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=sLienZu6KiCZOoxUGi0Wtl7eXGbJD/+90FiiErJoISo=; b=I423yN1n9Xlj1XM+MtgMF9tdv7Kf1nGCUBFPP0N5uPKTefxesX+k8bA3pXZ+GdqIeId/Cb Ed4HqD0q5FJHlRVSYcdxIY8dZHOX4WH94sd+8VqeArpaV8RRWlD6UDjp3jcizn7usCAfgS NYMnfcoFiXZVzMmnsIWnr/oXjUykusc= Received: from mail-vs1-f70.google.com (mail-vs1-f70.google.com [209.85.217.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-140-1Fya4VzKOsqLz_i_-VbliA-1; Fri, 01 Dec 2023 11:52:06 -0500 X-MC-Unique: 1Fya4VzKOsqLz_i_-VbliA-1 Received: by mail-vs1-f70.google.com with SMTP id ada2fe7eead31-464575e069aso766462137.0 for ; Fri, 01 Dec 2023 08:52:06 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701449526; x=1702054326; 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=sLienZu6KiCZOoxUGi0Wtl7eXGbJD/+90FiiErJoISo=; b=ac/ccQ+sv43otgBiHyIwWRrmSUI3DpCXlEkOO6t+ks1YIwMTQm+ZmEK86fJ5eNPuig j4FoaMklTnOWBkETDpl5rO0vhcKcQf9fRNOJcJ+YN5tpXsuxvGn+h74b/6MnuS0H9A+2 j4WopRn03EEoXFEu3WFGb4YMB4v1eyi72ksDsMF7lOUYCpsIe41YtHwN3r5NuPHsD2qK cjZNSqm6zqLNlr5Wdd+43SN25yux7VF6aSYyftv2BF1ocjoPEI2vEZT9MC/Be7zrHwRe Y5zdsOGjTQ0mZNM4HmVnKx3daAP35SYyeB5F+eaieZh2g1hoSXj/2fV2XwjidPpJfThF 5z7A== X-Gm-Message-State: AOJu0YwpJF8o+BI6KPRtR8hLphT1F3QOmm9uX2pmHrKczEF1+cvIFRGI o7G6516AOvwdQ2iPsHr4T/S8odMSlV2Q3gUUi1AC2q5VLf6nc/+6hQWV9KwyvKyX95Q0FsQTqp+ B/hGn8YaGbT7HA4zEPw== X-Received: by 2002:a67:cfc8:0:b0:464:4b49:3d4e with SMTP id h8-20020a67cfc8000000b004644b493d4emr9795880vsm.27.1701449526365; Fri, 01 Dec 2023 08:52:06 -0800 (PST) X-Google-Smtp-Source: AGHT+IHT5CLSPwCA+s3twU2Don349nLTg+5iAZHyasoCB15mGYeq0gS4Fm5CfaTuuSerPNyowlBPIA== X-Received: by 2002:a67:cfc8:0:b0:464:4b49:3d4e with SMTP id h8-20020a67cfc8000000b004644b493d4emr9795867vsm.27.1701449526083; Fri, 01 Dec 2023 08:52:06 -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 e12-20020ad4442c000000b0067a85603a45sm1570638qvt.7.2023.12.01.08.52.05 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 01 Dec 2023 08:52:05 -0800 (PST) Message-ID: <1b3b0259-5ce4-4193-a36d-60f09e1c7c92@redhat.com> Date: Fri, 1 Dec 2023 11:52:04 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 1/1] c++: Initial support for P0847R7 (Deducing This) [PR102609] To: waffl3x Cc: "gcc-patches@gcc.gnu.org" References: <7Xr5Vil7ptZzPaCtc_ZCdcTPuUVY7dheOnklF-vVDb5_jl8PivYWgTT_f3cKLvg7IMnDruCDDrICRI6WVrUT3f8ZScGKAh4ATIkYSuRqPZc=@protonmail.com> <-SP7aKgN1FZED-RAPr2FBDuCrcwnu9-UhHcRXNEsNZRwIzJXCdhVbtBP921Yn8g71d0WL7XpFRetUlBAStzRpZB8p4yj5moRS0DIE9D6cnY=@protonmail.com> <7623e2db-ba29-42f2-85df-c2e796d7305b@redhat.com> <_e1O52EjoN_BFiH31iHE-0eYegNJhoOdDN2O0mduqtMmt7qTGpRWgduxNppnO1si01rORJ470oWcoM-_lk1ICFo9lhe_ylBKQsJ791qMm_k=@protonmail.com> From: Jason Merrill In-Reply-To: <_e1O52EjoN_BFiH31iHE-0eYegNJhoOdDN2O0mduqtMmt7qTGpRWgduxNppnO1si01rORJ470oWcoM-_lk1ICFo9lhe_ylBKQsJ791qMm_k=@protonmail.com> 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.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H3,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 12/1/23 01:02, waffl3x wrote: > I ran into another issue while devising tests for redeclarations of > xobj member functions as static member functions and vice versa. I am > pretty sure by the literal wording of the standard, this is well formed. > > template > concept Constrain = true; > > struct S { > void f(this auto, Constrain auto) {}; > static void f(Constrain auto) {}; > > void g(this auto const&, Constrain auto) {}; > static void g(Constrain auto) {}; > > void h(this auto&&, Constrain auto) {}; > static void h(Constrain auto) {}; > }; > > And also, > > struct S{ > void f(this auto) {}; > static void f() {}; > > void g(this auto const&) {}; > static void g() {}; > > void h(this auto&&) {}; > static void h() {}; > }; > > I wrote these tests expecting them to be ill-formed, and found what I > thought was a bug when they were not diagnosed as redecelarations. > However, given how the code for resolving overloads and determining > redeclarations looks, I believe this is actually well formed on a > technicality. I can't find the passages in the standard that specify > this so I can't be sure. I think the relevant section is https://eel.is/c++draft/basic.scope.scope > Anyway, the template parameter list differs because of the deduced > object parameter. Now here is the question, you are required to ignore > the object parameter when determining if these are redeclarations or > not, but what about the template parameters associated with the object > parameter? Am I just missing the passage that specifies this or is this > an actual defect in the standard? I think that since they differ in template parameters, they don't correspond under https://eel.is/c++draft/basic.scope.scope#4.5 so they can be overloaded. This is specified in terms of the template-head grammar non-terminal, but elsewhere we say that abbreviated templates are equivalent to writing out the template parameters explicitly. > The annoying thing is, even if this was brought up, I think the only > solution is to ratify these examples as well formed. Yes. Jason