PR libstdc++/83626 Don't throw for remove("") and remove_all("")
authorJonathan Wakely <jwakely@redhat.com>
Thu, 4 Jan 2018 22:58:59 +0000 (22:58 +0000)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 4 Jan 2018 22:58:59 +0000 (22:58 +0000)
commit994844d36ad5215af397fa07fbb8c4f85f9e743f
treed56ca6c24dcfc46fd9e90c16f3a7bd1f63eb0ea2
parentac2be67b328e79b3be27b0559de62f054f8bf4c7
PR libstdc++/83626 Don't throw for remove("") and remove_all("")

PR libstdc++/83626
* src/filesystem/ops.cc (remove(const path&, error_code&))): Remove
redundant call to ec.clear().
(remove_all(const path&, error_code&))): Do not return an error for
non-existent paths.
* src/filesystem/std-ops.cc: Likewise.
* testsuite/27_io/filesystem/operations/remove.cc: New test.
* testsuite/27_io/filesystem/operations/remove_all.cc: Fix expected
results 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.

From-SVN: r256269
libstdc++-v3/ChangeLog
libstdc++-v3/src/filesystem/ops.cc
libstdc++-v3/src/filesystem/std-ops.cc
libstdc++-v3/testsuite/27_io/filesystem/operations/remove.cc [new file with mode: 0644]
libstdc++-v3/testsuite/27_io/filesystem/operations/remove_all.cc
libstdc++-v3/testsuite/experimental/filesystem/operations/remove.cc [new file with mode: 0644]
libstdc++-v3/testsuite/experimental/filesystem/operations/remove_all.cc