From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 13B79384800F; Mon, 1 Mar 2021 21:45:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 13B79384800F From: "moritz at bunkus dot org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/99333] New: std::filesystem::path().is_absolute() thinks UNC paths aren't absolute Date: Mon, 01 Mar 2021 21:45:13 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 10.2.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: moritz at bunkus dot org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone attachments.created Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Mar 2021 21:45:14 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99333 Bug ID: 99333 Summary: std::filesystem::path().is_absolute() thinks UNC paths aren't absolute Product: gcc Version: 10.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libstdc++ Assignee: unassigned at gcc dot gnu.org Reporter: moritz at bunkus dot org Target Milestone: --- Created attachment 50280 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=3D50280&action=3Dedit test case Compiling with gcc 10.2.0 from the mxe cross compilation environment for Windows. The attached sample program says it all. It shows that std::filesystem::("\\server\share\file.txt").is_absolute() is false and tur= ns std::filesystem::absolute("\\server\share\file.txt") into something like "C:\server\share\file.txt". boost::filesystem::path(=E2=80=A6).is_aboslute(), on the other hand, consid= ers UNC paths absolute & leaves them unmodified via boost::filesystem::absolute(=E2= =80=A6) The test program outputs the following: std::filesystem: original \\disky\mosu\existing_file.txt is_absolute 0 absolute "C:\\disky\\mosu\\existing_file.txt" boost::filesystem: original \\disky\mosu\existing_file.txt is_absolute 1 absolute "\\disky\mosu\existing_file.txt" Compile with something like: x86_64-w64-mingw32.static-g++ -std=3Dc++17 \ -I/home/mosu/prog/video/mingw/cross/usr/x86_64-w64-mingw32.static/include= \ -L/home/mosu/prog/video/mingw/cross/usr/x86_64-w64-mingw32.static/lib \ -o std_filesystem_unc_paths_vs_absolute.exe \ std_filesystem_unc_paths_vs_absolute.cpp \ -lboost_filesystem-mt-s-x64 -lboost_system-mt-s-x64=