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 011833858D39 for ; Tue, 19 Sep 2023 20:14:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 011833858D39 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=1695154464; 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=KbfnX4e2XtcWT5dsBuSM+ZsX7aD2i/d52yF3oJzKu/4=; b=T1xenkzacvEu/zFmXyhllDGE0+taxVPKC5sYRUeOOWsFjIenmmk+3j0LmYaB9kTfYKafE6 cRLqg1DQMAtH/F5sR1V9VRTo1nzXfTGx6o61nqP3stVftCRwT4XOqO6/6O9CCcBL4qyN1Y 1taxV4lZhHpmFLbzykXZzeaT52En7yM= Received: from mail-ot1-f69.google.com (mail-ot1-f69.google.com [209.85.210.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-464-xWffXCefOaK7IZO8Nb1A7g-1; Tue, 19 Sep 2023 16:14:23 -0400 X-MC-Unique: xWffXCefOaK7IZO8Nb1A7g-1 Received: by mail-ot1-f69.google.com with SMTP id 46e09a7af769-6c44e3b2141so3483371a34.2 for ; Tue, 19 Sep 2023 13:14:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695154462; x=1695759262; 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=KbfnX4e2XtcWT5dsBuSM+ZsX7aD2i/d52yF3oJzKu/4=; b=Cgypq0QwtvA4eFVtcarstok7wbuNn7+IuF6Uqa2Ru5ibo1KLJq7W0I0Z6WZIN0gvF3 pbJC7giS3FGNQ0aF/Wwpoe8RT50hXNbPRp7h8llJJnfb7XV/bnES3wNjHW817S4utLVa gByRjtCgZnojSflZA5rI/1pH2ngB4E90mtJYUtshAwzZmxNZ0cXHSVvVGAsTnJSX93Pk Y3WGVKQRPIDEsMD/A/PwMr3B7pBmg4NlJVV9l7y2AMbabNzd5V/emYkjcvu2wBb9Cdnf cvAXAxrMOfUglPGQEJ42P7YSZXscvt6o/zTDMyybMPxTb7CMlaT4WUDQkWU4rHSylW+d 5ALw== X-Gm-Message-State: AOJu0YyVQlajyYYJap1XSOg4bb8VG3lgiRhzdz8S0oe8Sy5NZ/sW5aej 8d7XztegFW4eshqIeqnd/hVIUwpxzdPsjceDWSYwMwwWjeac+U5lYceyh8vIqo87lIksP1fz9dX hkrlZ0VwtbAlSTsEXnQ== X-Received: by 2002:a05:6808:1895:b0:3a8:6d74:d591 with SMTP id bi21-20020a056808189500b003a86d74d591mr522044oib.0.1695154462650; Tue, 19 Sep 2023 13:14:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFd4yoSVypoWsxJ8cxm+vuF3Q+84QqoJdIQI1gqHfU3vL4wqDSG14aQ6XvylNGwYsoSSwf93g== X-Received: by 2002:a05:6808:1895:b0:3a8:6d74:d591 with SMTP id bi21-20020a056808189500b003a86d74d591mr522032oib.0.1695154462353; Tue, 19 Sep 2023 13:14:22 -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 p7-20020ac87407000000b00401e04c66fesm4064904qtq.37.2023.09.19.13.14.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 19 Sep 2023 13:14:21 -0700 (PDT) Message-ID: <3ec4cf47-ccd8-fc55-c4fc-d97402552b92@redhat.com> Date: Tue, 19 Sep 2023 16:14:20 -0400 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: 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=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,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/11/23 09:49, waffl3x via Gcc-patches wrote: > Bootstrapped and tested on x86_64-linux with no regressions. > > Hopefully I fixed all the issues. I also took the opportunity to remove the > small mistake present in v1, so that is no longer a concern. > > Thanks again for all the patience. > -Alex Thank you, this is great! One legal hurdle to start with: our DCO policy (https://gcc.gnu.org/dco.html) requires real names in the sign-off, not pseudonyms. If you would prefer to contribute under this pseudonym, I encourage you to file a copyright assignment with the FSF, who are set up to handle that. > +/* These need to moved to somewhere appropriate. */ This isn't a bad spot for these macros, but you could also move them down lower, maybe near DECL_THIS_STATIC and DECL_ARRAY_PARAMETER_P for some thematic connection. > +/* The flag is a member of base, but the value is meaningless for other > + decl types so checking is still justified I imagine. */ Absolutely, we often reuse bits for other purposes if they're disjoint from the use they were added for. > +/* Not a lang_decl field, but still specific to c++. */ > +#define DECL_PARM_XOBJ_FLAG(NODE) \ > + (PARM_DECL_CHECK (NODE)->decl_common.decl_flag_3) Better to use a DECL_LANG_FLAG than claim one of the language-independent flags for C++. There's a list at the top of cp-tree.h of the uses of *_LANG_FLAG_* on various kinds of tree node. DECL_LANG_FLAG_4 seems free on PARM_DECL. > + /* Only used for skipping over build_memfn_type, grokfndecl handles > + copying the flag to the correct field for a func_decl. > + There must be a better way to do this, but it isn't obvious how. */ > + bool is_xobj_member_function = false; > + auto get_xobj_parm = [](tree parm_list) I guess you could add a flag to the declarator, but this is fine too. Though I'd move this lambda down into the cdk_function case or out to a separate function. > case cdk_function: > { > + tree xobj_parm > + = get_xobj_parm (declarator->u.function.parameters); > + is_xobj_member_function = xobj_parm; I'd also move these down a few lines after the setting of 'raises'. > + /* Set the xobj flag for this parm, unfortunately > + I don't think there is a better way to do this. */ > + DECL_PARM_XOBJ_FLAG (decl) > + = decl_spec_seq_has_spec_p (declspecs, ds_this); This seems like a fine way to handle this. > + /* Special case for xobj parm, doesn't really belong up here > + (it applies to parm decls and those are mostly handled below > + the following specifiers) but I intend to refactor this function > + so I'm not worrying about it too much. > + The error diagnostics might be better elsewhere though. */ 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?). Jason