[libcxx] r273325 - Implement LWG issue 2725. The issue should move this meeting

Eric Fiselier via cfe-commits cfe-commits at lists.llvm.org
Tue Jun 21 15:11:17 PDT 2016


Author: ericwf
Date: Tue Jun 21 17:11:16 2016
New Revision: 273325

URL: http://llvm.org/viewvc/llvm-project?rev=273325&view=rev
Log:
Implement LWG issue 2725. The issue should move this meeting

Modified:
    libcxx/trunk/include/experimental/filesystem
    libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.exists/exists.pass.cpp

Modified: libcxx/trunk/include/experimental/filesystem
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/filesystem?rev=273325&r1=273324&r2=273325&view=diff
==============================================================================
--- libcxx/trunk/include/experimental/filesystem (original)
+++ libcxx/trunk/include/experimental/filesystem Tue Jun 21 17:11:16 2016
@@ -1393,7 +1393,9 @@ bool exists(const path& __p) {
 
 inline _LIBCPP_INLINE_VISIBILITY
 bool exists(const path& __p, error_code& __ec) _NOEXCEPT {
-    return exists(__status(__p, &__ec));
+    auto __s = __status(__p, &__ec);
+    if (status_known(__s)) __ec.clear();
+    return exists(__s);
 }
 
 inline _LIBCPP_INLINE_VISIBILITY

Modified: libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.exists/exists.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.exists/exists.pass.cpp?rev=273325&r1=273324&r2=273325&view=diff
==============================================================================
--- libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.exists/exists.pass.cpp (original)
+++ libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.exists/exists.pass.cpp Tue Jun 21 17:11:16 2016
@@ -65,6 +65,10 @@ TEST_CASE(test_exist_not_found)
 {
     const path p = StaticEnv::DNE;
     TEST_CHECK(exists(p) == false);
+
+    std::error_code ec = GetTestEC();
+    TEST_CHECK(exists(p, ec) == false);
+    TEST_CHECK(!ec);
 }
 
 TEST_CASE(test_exists_fails)




More information about the cfe-commits mailing list