From 833cf8bdb6e6050337e878b9946c0752d4550ac0 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 7 Feb 2017 02:46:59 +0000 Subject: 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 --- libcxx/src/experimental/filesystem/operations.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'libcxx/src/experimental/filesystem/operations.cpp') 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, -- cgit v1.2.3