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 03CB33858414 for ; Fri, 10 Feb 2023 17:10:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 03CB33858414 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=1676049008; 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=R8z2BDlS/I662HhhMvd994ydThv9bkesQ8QiQpzPXPs=; b=AjERwEefyBrUF5/0wNHO/yV8xkvQ1JmbRuE5+qhLbNu169PE+F6FkWo950JW2G1KNiCnzI nrt/WFRET14WrD5O5+sTj/+HMdCHyGeHV49bvE/MXXty4HGHqUcYQmsahhUYhlZE/OayLh HQCHLwO0wnVfPytbK8yaAcPDK4yVpSE= 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-484-qwmB8CNoP6iVlac14p-YoA-1; Fri, 10 Feb 2023 12:10:07 -0500 X-MC-Unique: qwmB8CNoP6iVlac14p-YoA-1 Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0798629A9D48; Fri, 10 Feb 2023 17:10:07 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.192.223]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B984E492B00; Fri, 10 Feb 2023 17:10:06 +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 31AHA4RE457385 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 10 Feb 2023 18:10:04 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 31AHA3Ff456027; Fri, 10 Feb 2023 18:10:03 +0100 Date: Fri, 10 Feb 2023 18:10:02 +0100 From: Jakub Jelinek To: Lewis Hyatt Cc: Jason Merrill , Nathan Sidwell , gcc-patches@gcc.gnu.org Subject: Re: Ping^3: [PATCH] libcpp: Handle extended characters in user-defined literal suffix [PR103902] Message-ID: Reply-To: Jakub Jelinek References: <20220614212649.GA58025@ldh-imac.local> <20220615190616.GA70682@ldh-imac.local> <20220926222725.GA19652@ldh-imac.local> MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.10 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=-3.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,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 Fri, Feb 10, 2023 at 11:58:03AM -0500, Lewis Hyatt wrote: > On Fri, Feb 10, 2023 at 11:30 AM Jakub Jelinek wrote: > > > > On Mon, Sep 26, 2022 at 06:27:25PM -0400, Lewis Hyatt via Gcc-patches wrote: > > > May I please ping this patch again? Joseph suggested that it would be best if > > > a C++ maintainer has a look at it. This is one of just a few places left where > > > we don't handle UTF-8 properly in libcpp, it would be really nice to get them > > > fixed up if there is time to review this patch. Thanks! > > > > CCing them. > > > > Just some nits from me, but I agree C++ maintainers are the best reviewers > > for this. > > Thanks so much for looking it over, I really appreciate it. I'll be > sure to incorporate all your feedback along with those from the full > review. > > Is this for stage 1 at this point BTW? It has been posted during stage 1, on the other side we are already almost a month into stage 4, and fixes an important bug which isn't a regression though. I'd defer to the reviewers to decide that. I've noticed this when seeing PR108717 being marked as dup of PR103902. > The is_macro() function was doing two jobs, first lexing the > identifier and looking it up in the hash table, and then calling > cpp_macro_p(). This was a bit duplicative because the identifier was > then immediately lexed again after the check. Since lexing it became > more complicated with UTF-8 support, I changed it not to duplicate > that effort and instead scan_cur_identifer() does the job once. With > that done, all that's left for is_macro() to do is just the one line > check so I got rid of it. However, I agree that the check about > suffix_begin is not really trivial and so factoring this out into one > place instead of two makes sense. I'll try to move the whole warning > into its own function in the next iteration. I agree, I just wanted to mention that if both of the callers need the same large comment and roughly or completely the same code that guards the cpp_warning, then it is a good candidate for a new helper, exactly like you've added for the large duplication in the first new function. Jakub