[Bug libstdc++/83626] std::experimental::filesystem::remove_all throws exception instead of returning 0 if path doesn't exist
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Mon Jan 15 12:39:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83626
--- Comment #15 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Author: redi
Date: Mon Jan 15 12:38:52 2018
New Revision: 256697
URL: https://gcc.gnu.org/viewcvs?rev=256697&root=gcc&view=rev
Log:
PR libstdc++/83626 Don't throw for remove("") and remove_all("")
Backport from mainline
2018-01-04 Jonathan Wakely <jwakely@redhat.com>
PR libstdc++/83626
* src/filesystem/ops.cc (remove(const path&, error_code&))): Do not
return an error for non-existent paths. Remove unnecessary
symlink_status call.
(remove_all(const path&)): Fix type of result variable.
(remove_all(const path&, error_code&))): Use non-throwing increment
for directory iterator. Do not return an error for non-existent paths.
* testsuite/experimental/filesystem/operations/remove.cc: New test.
* testsuite/experimental/filesystem/operations/remove_all.cc: Fix
expected results for non-existent paths.
Added:
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/filesystem/operations/remove.cc
- copied, changed from r256678,
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/filesystem/operations/remove_all.cc
Modified:
branches/gcc-6-branch/libstdc++-v3/ChangeLog
branches/gcc-6-branch/libstdc++-v3/src/filesystem/ops.cc
branches/gcc-6-branch/libstdc++-v3/testsuite/experimental/filesystem/operations/remove_all.cc
More information about the Gcc-bugs
mailing list