public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jonathan Wakely <jwakely@redhat.com>
To: Jonathan Wakely <jwakely@redhat.com>
Cc: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: [committed] libstdc++: Fix wstring conversions in filesystem::path [PR95048]
Date: Fri, 11 Nov 2022 22:32:22 +0000	[thread overview]
Message-ID: <CACb0b4moSw84e-VhTt-g-cWK-VstRztqMHzJ7P9sPY-=0O5m5w@mail.gmail.com> (raw)
In-Reply-To: <20221111174424.686786-1-jwakely@redhat.com>

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

On Fri, 11 Nov 2022 at 17:44, Jonathan Wakely via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> Tested x86_64-linux and x86_64-w64-ming32 (via Wine).

Sigh, I did test on Wine, but then what I pushed didn't include the
fix that was found thanks to that testing.

This is needed to prevent runtime errors on Windows when constructing
paths. Pushed to trunk.

[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 1264 bytes --]

commit 8214ec0cf33482f60139ae18a40567317e63c1ff
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Fri Nov 11 22:25:14 2022

    libstdc++: Fix <experimental/filesystem> for Windows [PR95048]
    
    I meant to include this change in r13-3909-gb331bf303bdc1e but I forgot
    to sync it from the machine where I did the mingw testing to the one
    where I pushed the commit.
    
    libstdc++-v3/ChangeLog:
    
            PR libstdc++/95048
            * include/experimental/bits/fs_path.h (path::_Cvt::_S_wconvert):
            Construct codecvt directly instead of getting it from the
            locale.

diff --git a/libstdc++-v3/include/experimental/bits/fs_path.h b/libstdc++-v3/include/experimental/bits/fs_path.h
index 6e2f47f5e63..a493e17a37e 100644
--- a/libstdc++-v3/include/experimental/bits/fs_path.h
+++ b/libstdc++-v3/include/experimental/bits/fs_path.h
@@ -792,8 +792,7 @@ namespace __detail
       static string_type
       _S_wconvert(const char* __f, const char* __l, const char*)
       {
-	using _Cvt = std::codecvt_utf8_utf16<wchar_t>;
-	const auto& __cvt = std::use_facet<_Cvt>(std::locale{});
+	std::codecvt_utf8_utf16<wchar_t> __cvt;
 	std::wstring __wstr;
 	if (__str_codecvt_in_all(__f, __l, __wstr, __cvt))
 	    return __wstr;

      reply	other threads:[~2022-11-11 22:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-11 17:44 Jonathan Wakely
2022-11-11 22:32 ` Jonathan Wakely [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='CACb0b4moSw84e-VhTt-g-cWK-VstRztqMHzJ7P9sPY-=0O5m5w@mail.gmail.com' \
    --to=jwakely@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --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).