summaryrefslogtreecommitdiff
path: root/libstdc++-v3
diff options
context:
space:
mode:
Diffstat (limited to 'libstdc++-v3')
-rw-r--r--libstdc++-v3/ChangeLog4
-rw-r--r--libstdc++-v3/include/bits/fs_ops.h7
-rw-r--r--libstdc++-v3/include/experimental/bits/fs_ops.h7
3 files changed, 14 insertions, 4 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 1fca54f212d..83361d45188 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,9 @@
2018-01-04 Jonathan Wakely <jwakely@redhat.com>
+ * include/bits/fs_ops.h (exists(const path&, error_code&))): Only
+ check status_known once.
+ * include/experimental/bits/fs_ops.h: Likewise.
+
PR libstdc++/83607
* include/std/functional (__is_byte_like): New trait.
(__is_std_equal_to): Remove.
diff --git a/libstdc++-v3/include/bits/fs_ops.h b/libstdc++-v3/include/bits/fs_ops.h
index 3c63adefca7..e61a1236bec 100644
--- a/libstdc++-v3/include/bits/fs_ops.h
+++ b/libstdc++-v3/include/bits/fs_ops.h
@@ -125,8 +125,11 @@ namespace filesystem
{
auto __s = status(__p, __ec);
if (status_known(__s))
- __ec.clear();
- return exists(__s);
+ {
+ __ec.clear();
+ return __s.type() != file_type::not_found;
+ }
+ return false;
}
uintmax_t file_size(const path& __p);
diff --git a/libstdc++-v3/include/experimental/bits/fs_ops.h b/libstdc++-v3/include/experimental/bits/fs_ops.h
index e36291195bb..45192b1b34a 100644
--- a/libstdc++-v3/include/experimental/bits/fs_ops.h
+++ b/libstdc++-v3/include/experimental/bits/fs_ops.h
@@ -131,8 +131,11 @@ inline namespace v1
{
auto __s = status(__p, __ec);
if (status_known(__s))
- __ec.clear();
- return exists(__s);
+ {
+ __ec.clear();
+ return __s.type() != file_type::not_found;
+ }
+ return false;
}
uintmax_t file_size(const path& __p);