Our Filesystem TS implementation treats // the same as //x which is probably wrong. It causes experimental/filesystem/operations/absolute.cc to FAIL on Windows, because absolute(path("//"), "z:\\tmp") returns "//\\tmp" which is a root-name. (On the other hand, the specification for experimental::filesystem::absolute is known to be broken for Windows, and was completely changed for C++17).
This patch: --- a/libstdc++-v3/src/filesystem/path.cc +++ b/libstdc++-v3/src/filesystem/path.cc @@ -377,7 +377,7 @@ path::_M_split_cmpts() if (len == 2) { // entire path is just "//" - _M_type = _Type::_Root_name; + _M_type = _Type::_Root_dir; return; } fixes the absolute.cc test on Windows and causes only one new FAIL (on all targets): /home/jwakely/src/gcc/gcc/libstdc++-v3/testsuite/experimental/filesystem/path/decompose/root_directory.cc:52: void test02(): Assertion 'rootdir.string()[0] != '/'' failed. FAIL: experimental/filesystem/path/decompose/root_directory.cc execution test The test seems questionable anyway: void test02() { for (const path p : __gnu_test::test_paths) { path rootdir = p.root_directory(); // If root-directory is composed of 'slash name', // 'slash' is excluded from the returned string. if (!rootdir.empty() && rootdir.string() != "/") VERIFY( rootdir.string()[0] != '/' ); } } This fails with the change because "//" behaves the same as "/" and so still has a leading slash.
*** Bug 113589 has been marked as a duplicate of this bug. ***