From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from fx308.security-mail.net (smtpout30.security-mail.net [85.31.212.38]) by sourceware.org (Postfix) with ESMTPS id AA93D3858C56 for ; Thu, 13 Oct 2022 15:14:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AA93D3858C56 Authentication-Results: sourceware.org; dmarc=fail (p=quarantine dis=none) header.from=kalrayinc.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kalray.eu Received: from localhost (localhost [127.0.0.1]) by fx308.security-mail.net (Postfix) with ESMTP id 492B720F740 for ; Thu, 13 Oct 2022 17:14:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kalrayinc.com; s=sec-sig-email; t=1665674045; bh=gr6D824j18kBeHk0/BUfky16z8p99UjDqP6K1xMvEKo=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=UDpdAq828t+zgjJYtLnJGzCyn/bXVLGoPfpGqEDmLw7llZiIkROpvCJHEg/ts3r51 czWgdJpu65OIxzjJwAAqRWtuq7Il3J6c54U6JFiwceMwDpY8wvqeKKm7iw32Hsopuj yqJwBr8mqc/IMv72HP5Q/a9MrLEKev/DaYe3dWeM= Received: from fx308 (localhost [127.0.0.1]) by fx308.security-mail.net (Postfix) with ESMTP id 2E7A720F5C5; Thu, 13 Oct 2022 17:14:05 +0200 (CEST) Received: from zimbra2.kalray.eu (unknown [217.181.231.53]) by fx308.security-mail.net (Postfix) with ESMTPS id 8939B20FB88; Thu, 13 Oct 2022 17:14:04 +0200 (CEST) Received: from zimbra2.kalray.eu (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTPS id 6A66D27E0454; Thu, 13 Oct 2022 17:14:04 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id 51A2D27E045B; Thu, 13 Oct 2022 17:14:04 +0200 (CEST) Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id MbhRw1rxzoHN; Thu, 13 Oct 2022 17:14:04 +0200 (CEST) Received: from localhost (unknown [192.168.37.51]) by zimbra2.kalray.eu (Postfix) with ESMTPSA id 34FA627E0454; Thu, 13 Oct 2022 17:14:04 +0200 (CEST) X-Virus-Scanned: E-securemail Secumail-id: <11a01.63482b3c.852b2.0> DKIM-Filter: OpenDKIM Filter v2.10.3 zimbra2.kalray.eu 51A2D27E045B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalrayinc.com; s=4F334102-7B72-11EB-A74E-42D0B9747555; t=1665674044; bh=z1NT6lvKWDyrqAaSY1je/wUEpAEoPAbO5jBKFauggiA=; h=Date:From:To:Message-ID:MIME-Version; b=Dtn/H5FnYeMH/NLA6fq0lNVtvbWEOrlGMjygaPtsOgvIZlKg5F1EV6lyzKyZk9bF7 2S98hbOsKr+6x2mmS6PMX8gb9oCslcm0ZFzjVCiHtEstCBYFFKWAy/wh/VFvdkjSBb SfZ2JgSnTxdipnCeM/Bk/mCna7AzLgVhriFJmpn+wc44RiB2LBpPxV+g7F40g0BlT+ TG2URAfM8sgwPSXBlbOe8ws6E37HPYuxarJm5XZzUIa7ijbH6974YyqYmKOhgXEzkY esOh37qBpxKXJ5y6MM1SBREIA7hlMvkJbU3BVHpvZE5ykP/Vfz1+knvi+My/vkWa22 OdIEFIdDx0yzg== Date: Thu, 13 Oct 2022 17:14:03 +0200 From: Paul Iannetta To: Jakub Jelinek Cc: Jason Merrill , gcc-patches@gcc.gnu.org Subject: Re: [PATCH v2] c++: parser - Support for target address spaces in C++ Message-ID: <20221013151403.uvbphivxbgsbzieh@ws2202.lin.mbt.kalray.eu> 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 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-ALTERMIMEV2_out: done X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,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 07:46:46AM +0200, Jakub Jelinek wrote: > 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 Thank you for the style review, I'll apply them in the next iteration. Paul