[PATCH v2] libstdc++: Fix handling of surrogate CP in codecvt [PR108976]

2023-03-21 Thread Dimitrij Mijoski via Gcc-patches
This patch fixes the handling of surrogate code points in all standard facets for transcoding Unicode that are based on std::codecvt. Surrogate code points should always be treated as error. On the other hand surrogate code units can only appear in UTF-16 and only when they come in a proper pair.

Re: [PATCH] libstdc++: Fix handling of surrogate CP in codecvt [PR108976]

2023-03-20 Thread Dimitrij Mijoski via Gcc-patches
On Mon, 2023-03-20 at 15:21 +, Jonathan Wakely wrote: > > Thanks, the patch looks OK to my uninformed eye, but I'm seeing a new > regression: > > /home/jwakely/src/gcc/gcc/libstdc++- > v3/testsuite/22_locale/codecvt/codecvt_utf16/79980.cc:86: void > test06(): Assertion 'result == u"from_bytes

[PATCH] libstdc++: Fix handling of surrogate CP in codecvt [PR108976]

2023-03-08 Thread Dimitrij Mijoski via Gcc-patches
This patch fixes the handling of surrogate code points in all standard facets for transcoding Unicode that are based on std::codecvt. Surrogate code points should always be treated as error. On the other hand surrogate code units can only appear in UTF-16 and only when they come in a proper pair.

[PATCH] libstdc++: testsuite: Add char8_t to codecvt_unicode

2023-02-08 Thread Dimitrij Mijoski via Gcc-patches
libstdc++-v3/ChangeLog: * testsuite/22_locale/codecvt/codecvt_unicode.cc: Rename functions. * testsuite/22_locale/codecvt/codecvt_unicode.h: Make more generic so it accepts char8_t. * testsuite/22_locale/codecvt/codecvt_unicode_wchar_t.cc: Rename

Re: [PATCH] libstdc++: testsuite: Simplify codecvt_unicode

2023-01-18 Thread Dimitrij Mijoski via Gcc-patches
On Wed, 2023-01-18 at 18:53 +, Jonathan Wakely wrote: > This doesn't compile in C++11 or C++14, because there's no guaranteed > elision. I see. I just looked up in the docs and found that I need to put --target_board=unix/-std=c++11 inside RUNTESTFLAGS to test in C++11 mode.

[PATCH] libstdc++: testsuite: Simplify codecvt_unicode

2023-01-17 Thread Dimitrij Mijoski via Gcc-patches
Stop using unique_ptr, create some objects directly. libstdc++-v3/ChangeLog: * testsuite/22_locale/codecvt/codecvt_unicode.cc: Simplify. * testsuite/22_locale/codecvt/codecvt_unicode.h: Simplify. * testsuite/22_locale/codecvt/codecvt_unicode_wchar_t.cc: Simplify. --- .../

Re: [PATCH v2] libstdc++: Fix Unicode codecvt and add tests [PR86419]

2023-01-10 Thread Dimitrij Mijoski via Gcc-patches
On Tue, 2023-01-10 at 13:28 +, Jonathan Wakely wrote: > Thanks for the patch. Do you have a copyright assignment for gcc > filed with the FSF?  Yes, I have already signed the copyright assignment.

[PATCH v2] libstdc++: Fix Unicode codecvt and add tests [PR86419]

2023-01-10 Thread Dimitrij Mijoski via Gcc-patches
Fixes the conversion from UTF-8 to UTF-16 to properly return partial instead ok. Fixes the conversion from UTF-16 to UTF-8 to properly return partial instead ok. Fixes the conversion from UTF-8 to UCS-2 to properly return partial instead error. Fixes the conversion from UTF-8 to UCS-2 to treat 4-by

[PATCH] libstdc++: Fix Unicode codecvt and add tests [PR86419]

2020-09-24 Thread Dimitrij Mijoski via Gcc-patches
Fixes the conversion from UTF-8 to UTF-16 to properly return partial instead ok. Fixes the conversion from UTF-16 to UTF-8 to properly return partial instead ok. Fixes the conversion from UTF-8 to UCS-2 to properly return partial instead error. Fixes the conversion from UTF-8 to UCS-2 to treat 4-by

[PATCH] Improve contrib/clang-format to work with C++11 code [PR97076]

2020-09-17 Thread Dimitrij Mijoski via Gcc-patches
contrib/ChangeLog: PR other/97076 * clang-format: Update. --- contrib/clang-format | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/clang-format b/contrib/clang-format index 7a4e96f64ca..ceb5c1d524f 100644 --- a/contrib/clang-format +++ b/contrib/clang-fo