From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qt1-x829.google.com (mail-qt1-x829.google.com [IPv6:2607:f8b0:4864:20::829]) by sourceware.org (Postfix) with ESMTPS id 8DAE7385276F for ; Fri, 12 May 2023 14:26:10 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8DAE7385276F Authentication-Results: sourceware.org; dmarc=pass (p=reject dis=none) header.from=kitware.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kitware.com Received: by mail-qt1-x829.google.com with SMTP id d75a77b69052e-3f38e1142d0so35565051cf.2 for ; Fri, 12 May 2023 07:26:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kitware.com; s=google; t=1683901570; x=1686493570; 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=d4lfdTaqyRwIq8gTManfM2iX2Xm2wvN9QUGQhaSiqkg=; b=bEL26rzJPvyHe9V71PqiG2VS9YV3oYiVHf+VL+O00FJLvVhEqLWTf0RaJisThhoC4/ MlrF2sLCASjHsYgmdl7zoLo9aOKChsZ3E3G7QtBiOJ5iHZ9xu9gXaXdwyzC01CeQ1AIj he0CfvemMpPEolLP8ZWc0RcMajiKL4uF1zr+Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683901570; x=1686493570; 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=d4lfdTaqyRwIq8gTManfM2iX2Xm2wvN9QUGQhaSiqkg=; b=UVlrRTqt/4yWVjKdv6oMYQ/GFGpJjE0LsHQtb3ucDTxuv7z/u1/uQRTouFjRyVplya kgFyMIWrTHZGURAkXffE5KpcHqDLuh9gBaAecuezUnuDjGQO3bhLfHFEjo6xEm/IRMmG snu+zN8leut/oslPS0U8Alu961EMudyzFbNKUusTSpPgO1uKNCC1qdyFZjh9V0wgjEXB cj/BhuplOoSaZ+dJbOSKYgCeNK7aNJPnfOyb2mSqQKX0cnKhpKuoH40KA0vu6foS8xI/ lMGubpI+STC2ADyz3prL1iSIQ9jQkcmZt2NR7qEjKq0nMJGViEQPxU3O/krSF/EvSqyo IFKA== X-Gm-Message-State: AC+VfDy0Q9yOKvJjPoPgNsiEOtHr+yUYiisrf2gokleW/kDDCBBk39aV TxetT/lFCaT4B0GTpSzJoo2EAA== X-Google-Smtp-Source: ACHHUZ7K2wSdR/cbxAK/PE37YQo4vYbec6exopaIWpbdikKqQj1de5QZ35c44cmj65BnScZRUwHZNw== X-Received: by 2002:a05:622a:14cc:b0:3ef:336f:56c6 with SMTP id u12-20020a05622a14cc00b003ef336f56c6mr42578109qtx.17.1683901569910; Fri, 12 May 2023 07:26:09 -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 b8-20020ac812c8000000b003f17f39af49sm3101495qtj.18.2023.05.12.07.26.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 May 2023 07:26:09 -0700 (PDT) Date: Fri, 12 May 2023 10:26:08 -0400 From: Ben Boeckel To: Jason Merrill Cc: gcc-patches@gcc.gnu.org, nathan@acm.org, fortran@gcc.gnu.org, gcc@gcc.gnu.org, brad.king@kitware.com Subject: Re: [PATCH v5 1/5] libcpp: reject codepoints above 0x10FFFF Message-ID: References: <20230125210636.2960049-1-ben.boeckel@kitware.com> <20230125210636.2960049-2-ben.boeckel@kitware.com> <6427dfd9-9ccd-c313-9251-75b9de8bc0af@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <6427dfd9-9ccd-c313-9251-75b9de8bc0af@redhat.com> User-Agent: Mutt/2.2.9 (2022-11-12) X-Spam-Status: No, score=-5.5 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,T_SCC_BODY_TEXT_LINE 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 Mon, Feb 13, 2023 at 10:53:17 -0500, Jason Merrill wrote: > On 1/25/23 13:06, Ben Boeckel wrote: > > Unicode does not support such values because they are unrepresentable in > > UTF-16. > > > > libcpp/ > > > > * charset.cc: Reject encodings of codepoints above 0x10FFFF. > > UTF-16 does not support such codepoints and therefore all > > Unicode rejects such values. > > It seems that this causes a bunch of testsuite failures from tests that > expect this limit to be checked elsewhere with a different diagnostic, > so I think the easiest thing is to fold this into _cpp_valid_utf8_str > instead, i.e.: Since then, `cpp_valid_utf8_p` has appeared and takes care of the over-long encodings. The new patchset just checks for codepoints beyond 0x10FFFF and rejects them in this function (and the test suite matches `master` results for me then). --Ben