summaryrefslogtreecommitdiffstats
path: root/libcxx/src/experimental/filesystem
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-10-16 00:47:59 +0000
committerEric Fiselier <eric@efcs.ca>2016-10-16 00:47:59 +0000
commitecafa8739e1b2ed2898ff1db3653657adacb99f1 (patch)
tree8c4477d678c144372971319b1a148c2a5a728771 /libcxx/src/experimental/filesystem
parent4fba10c3940919ba7a845bd785e6e05262d671a1 (diff)
downloadbcm5719-llvm-ecafa8739e1b2ed2898ff1db3653657adacb99f1.tar.gz
bcm5719-llvm-ecafa8739e1b2ed2898ff1db3653657adacb99f1.zip
Implement LWG 2712 and update other issues status
llvm-svn: 284318
Diffstat (limited to 'libcxx/src/experimental/filesystem')
-rw-r--r--libcxx/src/experimental/filesystem/operations.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/libcxx/src/experimental/filesystem/operations.cpp b/libcxx/src/experimental/filesystem/operations.cpp
index 4c60a17e976..6c7e4cf2488 100644
--- a/libcxx/src/experimental/filesystem/operations.cpp
+++ b/libcxx/src/experimental/filesystem/operations.cpp
@@ -282,6 +282,10 @@ bool __copy_file(const path& from, const path& to, copy_options options,
}
const bool to_exists = exists(to_st);
+ if (to_exists && !is_regular_file(to_st)) {
+ set_or_throw(make_error_code(errc::not_supported), ec, "copy_file", from, to);
+ return false;
+ }
if (to_exists && bool(copy_options::skip_existing & options)) {
return false;
}
@@ -302,6 +306,8 @@ bool __copy_file(const path& from, const path& to, copy_options options,
set_or_throw(make_error_code(errc::file_exists), ec, "copy", from, to);
return false;
}
+
+ _LIBCPP_UNREACHABLE();
}
void __copy_symlink(const path& existing_symlink, const path& new_symlink,
OpenPOWER on IntegriCloud