From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by sourceware.org (Postfix) with ESMTPS id 80ED23858C50 for ; Tue, 18 Oct 2022 12:18:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 80ED23858C50 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=kitware.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kitware.com Received: by mail-qk1-x734.google.com with SMTP id t25so8460675qkm.2 for ; Tue, 18 Oct 2022 05:18:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kitware.com; s=google; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=ol6FKRVJBArTsgfRSXixVrfWZxtp+I47R8LSB7c2cV4=; b=DsOL59UHLJmEKBY80UMN2CaA4U90JUG9yteuW3wfhchGHTqxvRcdd1MbH7z9Gwyj+S q/VNK+vqYq6z8BNMD4Hcz6gNv/QI8wR5YFWLmj5+M5PcBrzjarm2deZlbr6xXPbrJYzv 0TnHMgDebD76kvBncK/5FID4CkzBA97pizfHU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent:in-reply-to:content-disposition:mime-version:references :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ol6FKRVJBArTsgfRSXixVrfWZxtp+I47R8LSB7c2cV4=; b=efawpIlaLl96NP63LdRtxZM410CzfGb8l++MMx4KzkFBqsPQw3Q22ejQCihqIuICJ3 gQrA7PZYojL6hNnPaRIBZGl3a+7j3fEbMBfI+qJ0sR6IQoa91OdCPmweUvBn0V0ND3Xe F5JWz8w5LhnhaG+HrgKQ7jrIn90dzBZj82MbD4sUD+3S1NQPuq5IBsb3A6oeP4kFH/cE mLHG0Vfl+owScnKbz3OGZM/O+J4nkp777S/e19lEMG/cjlaF/uKy7SFvv8paahsH32hK sGRTyFf+3/no25mYmVyJ+M07QXF/uQ+HgglOwdSMvlFC8RafP3pZT6hSKf5iRksf6hEf +i2w== X-Gm-Message-State: ACrzQf1bc4MLwvVh7Sj+Q+5f3knCzYsLn1/8CT/xC2F8bBOvUM2HM9qg pZd5UufyUK2Bign8J2AWOeRLLw== X-Google-Smtp-Source: AMsMyM6UFxE81L8qkd1RJdSINGtT4JIPis/i72yb1Mlc3AA9HFf/Kr38wnc2Qr+EwVHn4COWB1R95g== X-Received: by 2002:a05:620a:4412:b0:6ed:9bf1:dfe9 with SMTP id v18-20020a05620a441200b006ed9bf1dfe9mr1556479qkp.375.1666095505815; Tue, 18 Oct 2022 05:18:25 -0700 (PDT) Received: from localhost (cpe-142-105-146-128.nycap.res.rr.com. [142.105.146.128]) by smtp.gmail.com with ESMTPSA id ay11-20020a05620a178b00b006ee96d82188sm345453qkb.1.2022.10.18.05.18.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Oct 2022 05:18:24 -0700 (PDT) Date: Tue, 18 Oct 2022 08:18:23 -0400 From: Ben Boeckel To: Jason Merrill Cc: Ben Boeckel , gcc-patches@gcc.gnu.org, nathan@acm.org, fortran@gcc.gnu.org, gcc@gcc.gnu.org, brad.king@kitware.com Subject: Re: [PATCH RESEND 1/1] p1689r5: initial support Message-ID: References: <20221004151200.1275636-1-ben.boeckel@kitware.com> <20221004151200.1275636-2-ben.boeckel@kitware.com> <78b88b1d-b328-a140-3a27-d33a3d96f3b9@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/2.2.7 (2022-08-07) X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,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 Tue, Oct 11, 2022 at 07:42:43 -0400, Ben Boeckel wrote: > On Mon, Oct 10, 2022 at 17:04:09 -0400, Jason Merrill wrote: > > Can we share utf8 parsing code with decode_utf8_char in pretty-print.cc? > > I can look at factoring that out. I'll have to decode its logic to see > how much overlap there is. There is some mismatch. First, that is in `gcc` and this is in `libcpp`. Second, `pretty-print.cc`'s implementation: - fails on an empty string; - accepts extended-length (5+-byte) encodings which are invalid Unicode; and - decodes codepoint-by-codepoint instead of just validating the entire string. --Ben