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 D96963850218 for ; Thu, 13 Oct 2022 05:46:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D96963850218 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=1665640017; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=gxdCf/6+SJS9LZ9OzvTNuCGUhmcJBg4Hpnvet1Z2tIk=; b=OTYuvHQa9AyJs7tFao7sFb+dOM4qU7dsNAskfajjcHIjYdqLBfO0/4KtWbjOCo9INz2//k l6sWgaOFV5pH3sUoxySQcTt4pIRMbsOnhtL/ECtzooMJBdq+5aDPOfdG9bVyiNmTVdwKbI 7+FUb8bOihF/2r9TmmXiISKm+4yyihQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-404-WbY8iWTGN_CjUtm9tCYDlA-1; Thu, 13 Oct 2022 01:46:51 -0400 X-MC-Unique: WbY8iWTGN_CjUtm9tCYDlA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 2781929AA389; Thu, 13 Oct 2022 05:46:51 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.55]) by smtp.corp.redhat.com (Postfix) with ESMTPS id DB8A640C6F9F; Thu, 13 Oct 2022 05:46:50 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 29D5klkw2959751 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 13 Oct 2022 07:46:48 +0200 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 29D5kl082959750; Thu, 13 Oct 2022 07:46:47 +0200 Date: Thu, 13 Oct 2022 07:46:46 +0200 From: Jakub Jelinek To: Paul Iannetta Cc: Jason Merrill , gcc-patches@gcc.gnu.org Subject: Re: [PATCH v2] c++: parser - Support for target address spaces in C++ Message-ID: Reply-To: Jakub Jelinek References: <20221006143400.es3u6ebqt3xkw6jp@ws2202.lin.mbt.kalray.eu> <697f23be-7318-1c87-5625-2411b1ab18a3@redhat.com> <20221009161256.p63tnxsqzwcnvh5h@ws2202.lin.mbt.kalray.eu> <20221011220017.pvs5jawrzqoaqkkf@ws2202.lin.mbt.kalray.eu> <19526772-3afb-87d1-190a-5ab0ffb566a9@redhat.com> <20221013005158.mfahyohzbywlyl7i@ws2202.lin.mbt.kalray.eu> MIME-Version: 1.0 In-Reply-To: <20221013005158.mfahyohzbywlyl7i@ws2202.lin.mbt.kalray.eu> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,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 Thu, Oct 13, 2022 at 02:52:59AM +0200, Paul Iannetta via Gcc-patches wrote: > + if (type != error_mark_node > + && !ADDR_SPACE_GENERIC_P (TYPE_ADDR_SPACE (type)) > + && current_function_decl) > + { > + error > + ("compound literal qualified by address-space qualifier"); > + type = error_mark_node; Can you please write this as: error ("compound literal qualified by address-space " "qualifier"); ? That is how diagnostics that don't fit on one line are usually written. > @@ -23812,6 +23830,11 @@ cp_parser_cv_qualifier_seq_opt (cp_parser* parser) > break; > } > > + if (RID_FIRST_ADDR_SPACE <= token->keyword && && should never go at the end of line. > + token->keyword <= RID_LAST_ADDR_SPACE) > + cv_qualifier = and similarly = (except for aggregate initializers). > + ENCODE_QUAL_ADDR_SPACE (token->keyword - RID_FIRST_ADDR_SPACE); So: if (RID_FIRST_ADDR_SPACE <= token->keyword && token->keyword <= RID_LAST_ADDR_SPACE) cv_qualifier = ENCODE_QUAL_ADDR_SPACE (token->keyword - RID_FIRST_ADDR_SPACE); > + int unified_cv = > + CLEAR_QUAL_ADDR_SPACE (arg_cv_quals & ~parm_cv_quals) > + | ENCODE_QUAL_ADDR_SPACE (as_common); Similarly (but this time with ()s added to ensure correct formatting in some editors). int unified_cv = (CLEAR_QUAL_ADDR_SPACE (arg_cv_quals & ~parm_cv_quals) | ENCODE_QUAL_ADDR_SPACE (as_common)); > result_type > = cp_build_qualified_type (void_type_node, > - (cp_type_quals (TREE_TYPE (t1)) > - | cp_type_quals (TREE_TYPE (t2)))); > + (CLEAR_QUAL_ADDR_SPACE (cp_type_quals (TREE_TYPE (t1))) > + | CLEAR_QUAL_ADDR_SPACE (cp_type_quals (TREE_TYPE (t2))) The above 2 lines are way too long. I'd suggest to use temporaries, say int quals1 = cp_type_quals (TREE_TYPE (t1)); int quals2 = cp_type_quals (TREE_TYPE (t2)); and use those. Jakub