From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 2FB0D398242D; Wed, 11 Aug 2021 15:42:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2FB0D398242D From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/101510] std::filesystem::create_directory on an existing symlink to a directory Date: Wed, 11 Aug 2021 15:42:54 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 11.1.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: 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: Wed, 11 Aug 2021 15:42:55 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D101510 --- Comment #19 from CVS Commits --- The releases/gcc-11 branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:bde28c60c70079416dd2181f882c0694e019eaef commit r11-8850-gbde28c60c70079416dd2181f882c0694e019eaef Author: Jonathan Wakely Date: Tue Jul 20 18:15:48 2021 +0100 libstdc++: Fix create_directories to resolve symlinks [PR101510] When filesystem__create_directories checks to see if the path already exists and resolves to a directory, it uses filesystem::symlink_status, which means it reports an error if the path is a symlink. It should use filesystem::status, so that the target directory is detected, and no error is reported. Signed-off-by: Jonathan Wakely libstdc++-v3/ChangeLog: PR libstdc++/101510 * src/c++17/fs_ops.cc (fs::create_directories): Use status instead of symlink_status. * src/filesystem/ops.cc (fs::create_directories): Likewise. * testsuite/27_io/filesystem/operations/create_directories.cc: Check symlink to existing directory. * testsuite/27_io/filesystem/operations/create_directory.cc: Do not test with symlinks on Windows. * testsuite/experimental/filesystem/operations/create_directories.cc: Check symlink to existing directory. * testsuite/experimental/filesystem/operations/create_directory= .cc: Do not test with symlinks on Windows. (cherry picked from commit 124eaa50e0a34f5f89572c1aa812c50979da58fc)=