From: Jakub Jelinek Date: Fri, 4 Nov 2022 17:20:36 +0000 (+0100) Subject: testsuite: Add testcase from C++23 P2314R4 - Character sets and encodings X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=95ba31bc4f88a0a2ff9f0ed41f3478cafcb9e040;p=platform%2Fupstream%2Fgcc.git 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 * g++.dg/cpp23/charset1.C: New testcase from C++23 P2314R4. --- 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);