[Bug libstdc++/93244] std::filesystem::path::generic_string doesn't convert the first slash on Windows

2020-05-12 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93244

--- Comment #14 from Martin Liška  ---
(In reply to CVS Commits from comment #13)
> The master branch has been updated by Martin Liska :
> 
> https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;
> h=af213b4c4ca30e55de64f8b1e0bf442df08f3e6d
> 
> commit r10-5851-gaf213b4c4ca30e55de64f8b1e0bf442df08f3e6d
> Author: Jonathan Wakely 
> Date:   Mon Jan 13 10:02:39 2020 +
> 
> libstdc++: Ensure root-dir converted to forward slash (PR93244)
> 
> PR libstdc++/93244
> * include/bits/fs_path.h (path::generic_string)
> [_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Convert root-dir to
> forward-slash.
> * testsuite/27_io/filesystem/path/generic/generic_string.cc:
> Check
> root-dir is converted to forward slash in generic pathname.
> * testsuite/27_io/filesystem/path/generic/utf.cc: New test.
> * testsuite/27_io/filesystem/path/generic/wchar_t.cc: New test.

Please ignore this message, it comes from a testing script.

[Bug libstdc++/93244] std::filesystem::path::generic_string doesn't convert the first slash on Windows

2020-05-12 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93244

--- Comment #13 from CVS Commits  ---
The master branch has been updated by Martin Liska :

https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=af213b4c4ca30e55de64f8b1e0bf442df08f3e6d

commit r10-5851-gaf213b4c4ca30e55de64f8b1e0bf442df08f3e6d
Author: Jonathan Wakely 
Date:   Mon Jan 13 10:02:39 2020 +

libstdc++: Ensure root-dir converted to forward slash (PR93244)

PR libstdc++/93244
* include/bits/fs_path.h (path::generic_string)
[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Convert root-dir to
forward-slash.
* testsuite/27_io/filesystem/path/generic/generic_string.cc: Check
root-dir is converted to forward slash in generic pathname.
* testsuite/27_io/filesystem/path/generic/utf.cc: New test.
* testsuite/27_io/filesystem/path/generic/wchar_t.cc: New test.

[Bug libstdc++/93244] std::filesystem::path::generic_string doesn't convert the first slash on Windows

2020-03-12 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93244

Martin Liška  changed:

   What|Removed |Added

 CC||marxin at gcc dot gnu.org

--- Comment #12 from Martin Liška  ---
commit r9-8365-g362c8772e7779d9e4730e2e51628ccaadce98bd0
Author: Jonathan Wakely 
Date:   Thu Mar 12 17:39:04 2020 +

libstdc++: Ensure root-dir converted to forward slash (PR93244)

Backport from mainline
2020-01-13  Jonathan Wakely  

PR libstdc++/93244
* include/bits/fs_path.h (path::generic_string)
[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Convert root-dir to
forward-slash.
* testsuite/27_io/filesystem/path/generic/generic_string.cc: Check
root-dir is converted to forward slash in generic pathname.
* testsuite/27_io/filesystem/path/generic/utf.cc: New test.
* testsuite/27_io/filesystem/path/generic/wchar_t.cc: New test.

[Bug libstdc++/93244] std::filesystem::path::generic_string doesn't convert the first slash on Windows

2020-03-12 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93244

Jonathan Wakely  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #11 from Jonathan Wakely  ---
Fixed for 9.4

[Bug libstdc++/93244] std::filesystem::path::generic_string doesn't convert the first slash on Windows

2020-03-12 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93244

Jakub Jelinek  changed:

   What|Removed |Added

   Target Milestone|9.3 |9.4

--- Comment #10 from Jakub Jelinek  ---
GCC 9.3.0 has been released, adjusting target milestone.

[Bug libstdc++/93244] std::filesystem::path::generic_string doesn't convert the first slash on Windows

2020-03-06 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93244

--- Comment #9 from Jonathan Wakely  ---
Doh, copy&paste error from the previous commit.

That belongs to PR 94069.

[Bug libstdc++/93244] std::filesystem::path::generic_string doesn't convert the first slash on Windows

2020-03-06 Thread orgads at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93244

--- Comment #8 from Orgad Shaneh  ---
(In reply to CVS Commits from comment #7)
> The master branch has been updated by Jonathan Wakely :
> 
> https://gcc.gnu.org/g:b0815713a32c5cc062bd41fa75dac4d4408215fb
> 
> commit r10-7064-gb0815713a32c5cc062bd41fa75dac4d4408215fb
> Author: Jonathan Wakely 
> Date:   Fri Mar 6 12:03:17 2020 +
> 
> libstdc++: Fix call to __glibcxx_rwlock_init (PR 93244)
> 
> When the target doesn't define PTHREAD_RWLOCK_INITIALIZER we use a
> wrapper around pthread_wrlock_init, but the wrapper only takes one
> argument and we try to call it with two.
> 
> This went unnnoticed on most targets because they do define the
> PTHREAD_RWLOCK_INITIALIZER macro, but it causes a bootstrap failure on
> darwin8.
> 
>   PR libstdc++/93244
>   * include/std/shared_mutex [!PTHREAD_RWLOCK_INITIALIZER]
>   (__shared_mutex_pthread::__shared_mutex_pthread()): Remove incorrect
>   second argument to __glibcxx_rwlock_init.
>   * testsuite/30_threads/shared_timed_mutex/94069.cc: New test.

Wrong bug?

[Bug libstdc++/93244] std::filesystem::path::generic_string doesn't convert the first slash on Windows

2020-03-06 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93244

--- Comment #7 from CVS Commits  ---
The master branch has been updated by Jonathan Wakely :

https://gcc.gnu.org/g:b0815713a32c5cc062bd41fa75dac4d4408215fb

commit r10-7064-gb0815713a32c5cc062bd41fa75dac4d4408215fb
Author: Jonathan Wakely 
Date:   Fri Mar 6 12:03:17 2020 +

libstdc++: Fix call to __glibcxx_rwlock_init (PR 93244)

When the target doesn't define PTHREAD_RWLOCK_INITIALIZER we use a
wrapper around pthread_wrlock_init, but the wrapper only takes one
argument and we try to call it with two.

This went unnnoticed on most targets because they do define the
PTHREAD_RWLOCK_INITIALIZER macro, but it causes a bootstrap failure on
darwin8.

PR libstdc++/93244
* include/std/shared_mutex [!PTHREAD_RWLOCK_INITIALIZER]
(__shared_mutex_pthread::__shared_mutex_pthread()): Remove incorrect
second argument to __glibcxx_rwlock_init.
* testsuite/30_threads/shared_timed_mutex/94069.cc: New test.

[Bug libstdc++/93244] std::filesystem::path::generic_string doesn't convert the first slash on Windows

2020-03-06 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93244

--- Comment #6 from CVS Commits  ---
The master branch has been updated by Jonathan Wakely :

https://gcc.gnu.org/g:180eeeaeb200a07f7f24e1f203cd026880ff861c

commit r10-7062-g180eeeaeb200a07f7f24e1f203cd026880ff861c
Author: Jonathan Wakely 
Date:   Fri Mar 6 11:27:34 2020 +

libstdc++: Fix failing filesystem::path tests (PR 93244)

The checks for PR 93244 don't actually pass on Windows (which is the
target where the bug is present) because of a different bug, PR 94063.

This adjusts the tests to not be affected by 94063 so that they verify
that 93244 was fixed.

PR libstdc++/93244
* testsuite/27_io/filesystem/path/generic/generic_string.cc: Adjust
test to not fail due to PR 94063.
* testsuite/27_io/filesystem/path/generic/utf.cc: Likewise.
* testsuite/27_io/filesystem/path/generic/wchar_t.cc: Likewise.

[Bug libstdc++/93244] std::filesystem::path::generic_string doesn't convert the first slash on Windows

2020-01-13 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93244

--- Comment #5 from Jonathan Wakely  ---
Basically GCC's filesystem lib has two kinds of behaviour, POSIX and Windows.

Cygwin is a subset of POSIX, as it works like it in most respects, but I also
added support for "//foo" as a root-name, which other POSIX systems don't
support.

The Windows behaviour is mostly independent, so if it should also support
"//foo" as a root-name, that needs to be done separately, as part of the
Windows semantics, not the POSIX (or Cygwin-POSIX) semantics.

[Bug libstdc++/93244] std::filesystem::path::generic_string doesn't convert the first slash on Windows

2020-01-13 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93244

--- Comment #4 from Jonathan Wakely  ---
I didn't implement support for that for MinGW, because I don't know how it
works for Windows (and I only vaguely know how it works for Cygwin). Please
create a separate bug report if you want to request that, it can be added.

[Bug libstdc++/93244] std::filesystem::path::generic_string doesn't convert the first slash on Windows

2020-01-13 Thread orgads at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93244

--- Comment #3 from Orgad Shaneh  ---
Thank you!

I've noticed in your changed that only on cygwin double leading slashes are
preserved. Why is that? I think it should be the same on all _WIN32 compilers,
like MinGW.

A shared folder is accessed by \\server\share\file.

[Bug libstdc++/93244] std::filesystem::path::generic_string doesn't convert the first slash on Windows

2020-01-13 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93244

--- Comment #2 from CVS Commits  ---
The master branch has been updated by Jonathan Wakely :

https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;h=fe7cc34fd5186cce3771e2bce2f4aacb81b9058c

commit r10-5915-gfe7cc34fd5186cce3771e2bce2f4aacb81b9058c
Author: Jonathan Wakely 
Date:   Mon Jan 13 10:02:39 2020 +

libstdc++: Ensure root-dir converted to forward slash (PR93244)

PR libstdc++/93244
* include/bits/fs_path.h (path::generic_string)
[_GLIBCXX_FILESYSTEM_IS_WINDOWS]: Convert root-dir to forward-slash.
* testsuite/27_io/filesystem/path/generic/generic_string.cc: Check
root-dir is converted to forward slash in generic pathname.
* testsuite/27_io/filesystem/path/generic/utf.cc: New test.
* testsuite/27_io/filesystem/path/generic/wchar_t.cc: New test.

[Bug libstdc++/93244] std::filesystem::path::generic_string doesn't convert the first slash on Windows

2020-01-13 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93244

Jonathan Wakely  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2020-01-13
  Component|c++ |libstdc++
   Assignee|unassigned at gcc dot gnu.org  |redi at gcc dot gnu.org
   Target Milestone|--- |9.3
 Ever confirmed|0   |1

--- Comment #1 from Jonathan Wakely  ---
Thanks for the analysis, I'll get it fixed.