summaryrefslogtreecommitdiffstats
path: root/libcxx/src/experimental/filesystem/operations.cpp
diff options
context:
space:
mode:
authorSaleem Abdulrasool <compnerd@compnerd.org>2017-02-07 02:46:59 +0000
committerSaleem Abdulrasool <compnerd@compnerd.org>2017-02-07 02:46:59 +0000
commit833cf8bdb6e6050337e878b9946c0752d4550ac0 (patch)
tree903cf6185b2c83b9bc31c75a0ebb1d0ab8cc54df /libcxx/src/experimental/filesystem/operations.cpp
parent0605f3fdddf5ceac03b26d3ce321aa454125fba4 (diff)
downloadbcm5719-llvm-833cf8bdb6e6050337e878b9946c0752d4550ac0.tar.gz
bcm5719-llvm-833cf8bdb6e6050337e878b9946c0752d4550ac0.zip
filesystem: return the constructed object
This really should get identified properly by the compiler to convert to a NVRO, but compress the code anyways. This makes the implementation identical to directory_iterator.cpp llvm-svn: 294270
Diffstat (limited to 'libcxx/src/experimental/filesystem/operations.cpp')
-rw-r--r--libcxx/src/experimental/filesystem/operations.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/libcxx/src/experimental/filesystem/operations.cpp b/libcxx/src/experimental/filesystem/operations.cpp
index 4ca7727d06c..bd7685819ec 100644
--- a/libcxx/src/experimental/filesystem/operations.cpp
+++ b/libcxx/src/experimental/filesystem/operations.cpp
@@ -35,12 +35,9 @@ namespace detail { namespace {
using value_type = path::value_type;
using string_type = path::string_type;
-
-
inline std::error_code capture_errno() {
- _LIBCPP_ASSERT(errno, "Expected errno to be non-zero");
- std::error_code m_ec(errno, std::generic_category());
- return m_ec;
+ _LIBCPP_ASSERT(errno, "Expected errno to be non-zero");
+ return std::error_code(errno, std::generic_category());
}
void set_or_throw(std::error_code const& m_ec, std::error_code* ec,
OpenPOWER on IntegriCloud