aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVille Voutilainen <ville.voutilainen@gmail.com>2016-07-04 12:52:49 +0000
committerVille Voutilainen <ville.voutilainen@gmail.com>2016-07-04 12:52:49 +0000
commit2cf13c1cd51addc7149d57cfcc8bcb2ffb155298 (patch)
tree38bed5547602f37fd3a38f274d966a8ef1d304dc
parentc842b89727a34bbbc0c20d180c9bab52919e39d9 (diff)
PR libstdc++/71313
* src/filesystem/ops.cc (remove_all(const path&, error_code&)): Call remove_all for children of a directory. * testsuite/experimental/filesystem/operations/create_directories.cc: Adjust. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@237978 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--libstdc++-v3/ChangeLog8
-rw-r--r--libstdc++-v3/src/filesystem/ops.cc2
-rw-r--r--libstdc++-v3/testsuite/experimental/filesystem/operations/create_directories.cc3
3 files changed, 11 insertions, 2 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 53d040573a5..92d7a4d006c 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,11 @@
+2016-07-04 Ville Voutilainen <ville.voutilainen@gmail.com>
+
+ PR libstdc++/71313
+ * src/filesystem/ops.cc (remove_all(const path&, error_code&)):
+ Call remove_all for children of a directory.
+ * testsuite/experimental/filesystem/operations/create_directories.cc:
+ Adjust.
+
2016-07-02 François Dumont <fdumont@gcc.gnu.org>
* testsuite/23_containers/array/tuple_interface/get_debug_neg.cc: Adjust
diff --git a/libstdc++-v3/src/filesystem/ops.cc b/libstdc++-v3/src/filesystem/ops.cc
index 67ed8e6e564..9fb5b639fc0 100644
--- a/libstdc++-v3/src/filesystem/ops.cc
+++ b/libstdc++-v3/src/filesystem/ops.cc
@@ -1194,7 +1194,7 @@ fs::remove_all(const path& p, error_code& ec) noexcept
uintmax_t count = 0;
if (ec.value() == 0 && fs.type() == file_type::directory)
for (directory_iterator d(p, ec), end; ec.value() == 0 && d != end; ++d)
- count += fs::remove(d->path(), ec);
+ count += fs::remove_all(d->path(), ec);
if (ec.value())
return -1;
return fs::remove(p, ec) ? ++count : -1; // fs:remove() calls ec.clear()
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/operations/create_directories.cc b/libstdc++-v3/testsuite/experimental/filesystem/operations/create_directories.cc
index 4be41a6c47c..a52efe4ce5c 100644
--- a/libstdc++-v3/testsuite/experimental/filesystem/operations/create_directories.cc
+++ b/libstdc++-v3/testsuite/experimental/filesystem/operations/create_directories.cc
@@ -65,7 +65,8 @@ test01()
VERIFY( b );
VERIFY( is_directory(p/"./d4/../d5") );
- remove_all(p, ec);
+ std::uintmax_t count = remove_all(p, ec);
+ VERIFY( count == 6 );
}
int