Implement LWG issue 2725. The issue should move this meeting
llvm-svn: 273325
This commit is contained in:
parent
606a338db9
commit
310d3b975f
|
@ -1393,7 +1393,9 @@ bool exists(const path& __p) {
|
||||||
|
|
||||||
inline _LIBCPP_INLINE_VISIBILITY
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
bool exists(const path& __p, error_code& __ec) _NOEXCEPT {
|
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
|
inline _LIBCPP_INLINE_VISIBILITY
|
||||||
|
|
|
@ -65,6 +65,10 @@ TEST_CASE(test_exist_not_found)
|
||||||
{
|
{
|
||||||
const path p = StaticEnv::DNE;
|
const path p = StaticEnv::DNE;
|
||||||
TEST_CHECK(exists(p) == false);
|
TEST_CHECK(exists(p) == false);
|
||||||
|
|
||||||
|
std::error_code ec = GetTestEC();
|
||||||
|
TEST_CHECK(exists(p, ec) == false);
|
||||||
|
TEST_CHECK(!ec);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_CASE(test_exists_fails)
|
TEST_CASE(test_exists_fails)
|
||||||
|
|
Loading…
Reference in New Issue