public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Dimitrij Mijoski <dmjpp@hotmail.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: gcc-patches@gcc.gnu.org, libstdc++@gcc.gnu.org
Subject: Re: [PATCH] libstdc++: Fix handling of surrogate CP in codecvt [PR108976]
Date: Mon, 20 Mar 2023 18:45:47 +0100	[thread overview]
Message-ID: <AS1P192MB1620083C855C5DBDBAB75791AC809@AS1P192MB1620.EURP192.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <CACb0b4m-5r7aStZY=yc+75nf5bX18Q-nMgsktjqWK7-VT8WQXg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1557 bytes --]

On Mon, 2023-03-20 at 15:21 +0000, 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 failed"' failed.
> FAIL: 22_locale/codecvt/codecvt_utf16/79980.cc execution test

Most likely this regression appears because the change related to the
case when odd number of bytes are given to std::codecvt_utf16::in().
The old test 79980.cc:86: void test06() is probably wrong and it should
be changed.


> Also, I see that libc++ fails some of your new tests the same way as
> current libstdc++ does:
> 
> unicode: /home/jwakely/src/gcc/gcc/libstdc++-
> v3/testsuite/22_locale/codecvt/codecvt_unicode.h:298: void
> utf8_to_utf32_in_error(const std::codecvt<InternT, ExternT,
> mbstate_t> &) [InternT = char32_t, ExternT = char]: Assertion `res ==
> cvt.error' failed.
> Aborted (core dumped)
> 
> Does that mean they have the same problem? Or is the test wrong? Or
> is your patch implementing something that contradicts the
> requirements of the standard? I think it's that libc++ has the same
> handling of surrogates, but I'd like to be sure that's right.

See bug https://github.com/llvm/llvm-project/issues/60177 . It can be
reproduced with the testsuite codecvt_unicode without this patch, it is
not related to surrogates. GCC had that bug too but I already fixed it
with my previous big patch on the codecvts.

      reply	other threads:[~2023-03-20 17:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-08 14:08 Dimitrij Mijoski
2023-03-20 15:21 ` Jonathan Wakely
2023-03-20 17:45   ` Dimitrij Mijoski [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AS1P192MB1620083C855C5DBDBAB75791AC809@AS1P192MB1620.EURP192.PROD.OUTLOOK.COM \
    --to=dmjpp@hotmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=jwakely@redhat.com \
    --cc=libstdc++@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).