From patchwork Fri Nov 4 09:14:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jakub Jelinek X-Patchwork-Id: 15430 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp268631wru; Fri, 4 Nov 2022 02:16:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4eaO0Cvy58g9j2rItzKnmwvl/MsSvE4/wDJydL1sVJ2FusD5Qw8AHVB7Jopqbscq94PBdF X-Received: by 2002:a17:906:eeca:b0:730:6880:c397 with SMTP id wu10-20020a170906eeca00b007306880c397mr32601064ejb.593.1667553365572; Fri, 04 Nov 2022 02:16:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667553365; cv=none; d=google.com; s=arc-20160816; b=yeLg9EOo5A3Cw4jwZeqS0UXJfOhIT5/hH9VXiTWoKoZ+29krrWYgv7qM+HGM01asjS F6EarUFoLwRZ+ItFeGeWouCHUU+A2nmyIKcqQIcoa9m233IylbzcapPbVWYVG3qF14CJ kDmR3M6XGzVSTTitj7Xlzhv5KaeodAFRVW5yVVlvjADLCJ6F+i6rQdC4YpJNH+oINSAQ kO4acNS6rvoX9aO1n8qaQjKssArfy5TFx8nn4YC7HyysJy2daPezdFkveqw+JsT4GCUT yIqkWyfDmvmQW+8gnbhH8BQTyiDK4VsATtrB2uyl6JwBgiZ/88Fkw+BzG8tvCzpYyuyv K29Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:reply-to:from:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence :content-transfer-encoding:content-disposition:mime-version :message-id:subject:to:date:dmarc-filter:delivered-to:dkim-signature :dkim-filter; bh=KNH4gqr+hZM6RnQkgt/jRPOy6oXbRVjFSPeMfanpv5k=; b=JJKR7Ls5m+I/UQhcwwlkKKVaJjYUKuFW8xz+ZYzYGJ0YMdTiRBk7r52q5Py9KFW1yK gZwXMCmwCVcaNQULGdYwe3qwZAghzt5VNWmnrs9T6c1+EX9bT3pThWKw5CeBMiRlJpdQ bZ7z+InnyPcJUHc5ulxqpDTWI0ZFqdMsJq2Eyc6OJdeFEYWANTaiFAa345CJVacR9Oc8 E0tvvsovs7T7fWt/nLAAuIXA4AseqZAwvJ5Djb/Un2hy3v7EobmNBZ/f0DXPys5PeXPK iIwMkb/Te8cWpjVgey2MfmXoQ0oij9hvkg7L5Werhmakqo/hVWzGVMfAjcF62vneoYJG x5CQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=XAcBTk0b; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id n19-20020a509353000000b00459101ecc5esi3322982eda.468.2022.11.04.02.16.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 02:16:05 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@gcc.gnu.org header.s=default header.b=XAcBTk0b; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gnu.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7F6223858403 for ; Fri, 4 Nov 2022 09:16:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7F6223858403 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1667553364; bh=KNH4gqr+hZM6RnQkgt/jRPOy6oXbRVjFSPeMfanpv5k=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=XAcBTk0bK4o2t/IrxMj8B6p526EQrrZlnGgbPGNt6LGOh+FJMOJCy09nMoc0/CzZ0 w3nWRkPTwI90/jGtp2+WaT7AGcY3tK2VEC7btrYWw1VyppJ82cBDlFKuh25fetkI1N 52jBpK09YdW6TLoY1HWErdIMQrIDuHBY7CbQz/uM= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org 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 615BC3858403 for ; Fri, 4 Nov 2022 09:14:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 615BC3858403 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-56-OQ7gruUXNuC0ITM2AZ5qUQ-1; Fri, 04 Nov 2022 05:14:38 -0400 X-MC-Unique: OQ7gruUXNuC0ITM2AZ5qUQ-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 71F623814953 for ; Fri, 4 Nov 2022 09:14:38 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.193.252]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2EE3D40C6EE9; Fri, 4 Nov 2022 09:14:38 +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 2A49EZL02675210 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Fri, 4 Nov 2022 10:14:36 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 2A49EZUu2675209; Fri, 4 Nov 2022 10:14:35 +0100 Date: Fri, 4 Nov 2022 10:14:35 +0100 To: Jason Merrill Subject: [PATCH] testsuite: Add testcase from C++23 P2314R4 - Character sets and encodings Message-ID: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-Spam-Status: No, score=-4.4 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 X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Jakub Jelinek via Gcc-patches From: Jakub Jelinek Reply-To: Jakub Jelinek Cc: gcc-patches@gcc.gnu.org Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748556438073279008?= X-GMAIL-MSGID: =?utf-8?q?1748556438073279008?= Hi! I've read the paper and I believe we just implement it with no changes needed (at least since PR67224 and similar libcpp changes in GCC 10), but I could be wrong. The following patch at least adds a testcase from the start of the paper. Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk? Do you agree that we can mark the paper as implemented or do you think we need to change something (what?)? 2022-11-04 Jakub Jelinek * g++.dg/cpp23/charset1.C: New testcase from C++23 P2314R4. Jakub --- gcc/testsuite/g++.dg/cpp23/charset1.C.jj 2022-11-03 10:56:48.114588796 +0100 +++ gcc/testsuite/g++.dg/cpp23/charset1.C 2022-11-03 10:56:39.162711201 +0100 @@ -0,0 +1,10 @@ +// P2314R4 +// { dg-do compile { target c++23 } } +// { dg-options "-finput-charset=UTF-8 -fexec-charset=UTF-8" } + +#define S(x) # x +const char s1[] = S(Köppe); // "Köppe" +const char s2[] = S(K\u00f6ppe); // "Köppe" + +static_assert (sizeof (s1) == 7); +static_assert (sizeof (s2) == 7);