Question about developing for std::filesystem
Jonathan Wakely
jwakely@redhat.com
Fri Jul 18 19:58:44 GMT 2025
On Fri, 18 Jul 2025 at 20:54, Jonathan Wakely <jwakely@redhat.com> wrote:
>
> On Fri, 18 Jul 2025 at 19:22, Adam Wood <adam.wood@mines.sdsmt.edu> wrote:
> >
> > Hello everyone,
> > I am currently working on a patch to add symlink support on Windows. I
>
> Nice, thanks!
>
> > am currently only changing files in the c++17 folder (with the
> > exception of ops_common.h in filesystem folder). I have three
> > questions:
> > 1. Should I make the same changes to the equivalent files in the
> > filesystem folder as well?
>
> No, that's the implementation of the Filesystem TS and it barely
> supports Windows at all. Let it rest in peace.
>
> > 2. Are the std::filesystem tests using the standard c++17 filesystem
> > library or the gnu one?
>
> I'm not sure what you mean here, sorry.
The tests under testsuite/27_io/filesystem are testing the
std::filesystem library defined in C++17.
The tests under testsuite/experimental/filesystem are testing the
std::experimental::filesystem library defined in the Filesystem TS.
But that's not a gnu library, it's an ISO Technical Specification,
https://www.iso.org/standard/63483.html (which has now been withdrawn,
because it was incorporated into C++17, with various improvements).
We have two filesystem libraries, the standard one (std::filesystem,
in the header <filesystem>), and the older TS
(std::experimental::filesystem, in the header
<experimental/filesystem>). There are two independent sets of tests,
because there are some differences in semantics between
std::filesystem and std::experimental::filesystem, so they need
different tests.
I don't know if that answers what you're asking.
>
> > 3. What is the difference between "execution test" and "(test for
> > excess errors)" in the testsuite?
>
> When a test has the action { dg-do run } that means it needs to be
> successfully compiled (with no unexpected warnings or errors, i.e. no
> "excess errors") and then successfully run.
>
> The test for excess errors is compiling it and checking there are no
> warnings or errors.
> The execution test is executing it.
>
> When a test has { dg-do compile } or { dg-do link } then it will not
> be executed, so you won't see the "execution test" step.
More information about the Libstdc++
mailing list