public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r13-3692] testsuite: Add testcase from C++23 P2314R4 - Character sets and encodings
@ 2022-11-04 17:21 Jakub Jelinek
0 siblings, 0 replies; only message in thread
From: Jakub Jelinek @ 2022-11-04 17:21 UTC (permalink / raw)
To: gcc-cvs
https://gcc.gnu.org/g:95ba31bc4f88a0a2ff9f0ed41f3478cafcb9e040
commit r13-3692-g95ba31bc4f88a0a2ff9f0ed41f3478cafcb9e040
Author: Jakub Jelinek <jakub@redhat.com>
Date: Fri Nov 4 18:20:36 2022 +0100
testsuite: Add testcase from C++23 P2314R4 - Character sets and encodings
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.
2022-11-04 Jakub Jelinek <jakub@redhat.com>
* g++.dg/cpp23/charset1.C: New testcase from C++23 P2314R4.
Diff:
---
gcc/testsuite/g++.dg/cpp23/charset1.C | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/gcc/testsuite/g++.dg/cpp23/charset1.C b/gcc/testsuite/g++.dg/cpp23/charset1.C
new file mode 100644
index 00000000000..d6f0d1c997b
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp23/charset1.C
@@ -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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-11-04 17:21 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-04 17:21 [gcc r13-3692] testsuite: Add testcase from C++23 P2314R4 - Character sets and encodings Jakub Jelinek
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).