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 1806B3858D33 for ; Fri, 22 Sep 2023 11:30:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1806B3858D33 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695382239; 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=kjzaZ7x+V9cOChFvqcl6/99R2AgJjPx3him2frp9nZc=; b=PEny+JbyQbAMzkTV5UEIhkBrW/wppWDdI+eC1NJeWLWIv6SG9fEcwO7ImA8+3Wo9llkY65 BzclCWYtig+SF2JWwLAtZlDXTGNpa5TiXTdq+az4OsRPgnUXI3dDAKwZbqW4Y7H2LlrrZJ qAadsLLdaqNNxzZo9KYmZ5gUfvQ68rU= Received: from mail-wr1-f70.google.com (mail-wr1-f70.google.com [209.85.221.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-682-5oM7pOFTNy-ac8sngD8l8w-1; Fri, 22 Sep 2023 07:30:37 -0400 X-MC-Unique: 5oM7pOFTNy-ac8sngD8l8w-1 Received: by mail-wr1-f70.google.com with SMTP id ffacd0b85a97d-320004980a2so1285604f8f.1 for ; Fri, 22 Sep 2023 04:30:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695382236; x=1695987036; 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=kjzaZ7x+V9cOChFvqcl6/99R2AgJjPx3him2frp9nZc=; b=svIQDfvu5W/7Oemqky+YLM8kyRM/DQtJ7QtenmSQZ9p3a2KOumitq1zmEFEajeL/5w CuSKx9RYpKDcDXiKu3NO9PdMPumLtU9Lgb8JmA+jEpuwc/ZQbGNaHADdSQaDIjj77EGS RmYlKBkC+oRtsCFxrCBzzk+bkfXTU9Fihf8RYvIATWYTTEr6D4I8DbzjmSigdWRQUOJC oi0p3+yzVCPJG8ZUXyIJoFJIj0i8nlNZ/wnU4aXmKpii517BUdRK8J78VLUgKK2ogOLS +NQDgvVQ+Kbb+HCnOZ5Ct2+nE/ItWMJ9jebtekox03Dtx2066aZ5xJw4Bz6nMmfpezgY uo7g== X-Gm-Message-State: AOJu0YyCjN+7dpnkZcV4k42LT8nawXR6hMriYZ+iON3Ccbg8pqNepMI8 yXLo/hZ6+2HWZ6E+evk4eAJdTRlsAxMDBTWtzwFTP0rzrEW57FxJL2WZG8FvgoWl87WGM60Hcq2 Mqbp0br9bIWSr4xh9lA== X-Received: by 2002:adf:a3c1:0:b0:321:7844:de44 with SMTP id m1-20020adfa3c1000000b003217844de44mr5906803wrb.45.1695382236556; Fri, 22 Sep 2023 04:30:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFc81xp78CwaKpkaxTA1OmTmj4x+ZNxY0c7laMsr/kNtGZFn5U8vCxmv+sdDUbeX9pUPjIFVg== X-Received: by 2002:adf:a3c1:0:b0:321:7844:de44 with SMTP id m1-20020adfa3c1000000b003217844de44mr5906783wrb.45.1695382236200; Fri, 22 Sep 2023 04:30:36 -0700 (PDT) Received: from [10.228.3.177] ([195.89.33.213]) by smtp.gmail.com with ESMTPSA id d21-20020adfa355000000b0031c5dda3aedsm1979759wrb.95.2023.09.22.04.30.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Sep 2023 04:30:35 -0700 (PDT) Message-ID: <2024d9f2-7560-eb9e-e9d9-de8769a06a8b@redhat.com> Date: Fri, 22 Sep 2023 12:30:34 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v2 1/2] c++: Initial support for P0847R7 (Deducing This) [PR102609] To: waffl3x Cc: Jakub Jelinek , "gcc-patches@gcc.gnu.org" References: <3ec4cf47-ccd8-fc55-c4fc-d97402552b92@redhat.com> <9evl-z9cAecBNAGVh82igdeO_HCFYbASO5fS0ngotJBqdpab09FTYaMiAjlZUliISedO0mV66BldzWQtylI4Dax0yC2gdKWuM55xDaG6RQM=@protonmail.com> <09e57c81-5231-16e8-6e57-18c37663c325@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.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 9/21/23 07:28, waffl3x wrote: >> This seems like a reasonable place for it since 'this' is supposed to >> precede the decl-specifiers, and since we are parsing initial attributes >> here rather than in the caller. You will want to give an error if >> found_decl_spec is set. And elsewhere complain about 'this' on >> parameters after the first (in cp_parser_parameter_declaration_list?), >> or in a non-member/lambda (in grokdeclarator?). > > Bringing this back up, I recalled another detail regarding this. > > I'm pretty sure that found_decl_spec can be false when parsing the > second or latter decl-specifier. I tested it quickly and I believe I am > correct. I raise this as my diagnostics patch introduces another > variable to track whether we are on the first decl-specifier, given the > results of my quick test, I believe that was the correct choice. Makes sense. > This kinda unclear machinery is what makes me really want to refactor > this code, but I've resisted as it would be inappropriate to try to do > so while implementing a feature. Once I am finished implementing > `deducing this` would you be open to me refactoring grokdeclarator and > it's various auxiliary functions? Yes, but I'll warn you that grokdeclarator has resisted refactoring for a long time... Jason