aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2022-11-04 18:20:36 +0100
committerJakub Jelinek <jakub@redhat.com>2022-11-04 18:20:36 +0100
commit95ba31bc4f88a0a2ff9f0ed41f3478cafcb9e040 (patch)
treecf8ec068a9fa80e9159d122ae34f883835f39bc8
parent2662d537b0397b3d8cd6e8ea0568d310f0b85f87 (diff)
downloadgcc-95ba31bc4f88a0a2ff9f0ed41f3478cafcb9e040.zip
gcc-95ba31bc4f88a0a2ff9f0ed41f3478cafcb9e040.tar.gz
gcc-95ba31bc4f88a0a2ff9f0ed41f3478cafcb9e040.tar.bz2
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.
-rw-r--r--gcc/testsuite/g++.dg/cpp23/charset1.C10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp23/charset1.C b/gcc/testsuite/g++.dg/cpp23/charset1.C
new file mode 100644
index 0000000..d6f0d1c
--- /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);