diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2016-10-21 18:00:59 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2016-10-21 18:00:59 +0100 |
commit | 2be921271333c81ec9fcf71ba49110bf23971d09 (patch) | |
tree | b8178b78f1624dff2b5fe484dcb72077cf54e82a /libstdc++-v3/src | |
parent | e59e183f69dcfac77e043854ca2ef37120c6eda1 (diff) | |
download | gcc-2be921271333c81ec9fcf71ba49110bf23971d09.zip gcc-2be921271333c81ec9fcf71ba49110bf23971d09.tar.gz gcc-2be921271333c81ec9fcf71ba49110bf23971d09.tar.bz2 |
LWG2725 Fix error reporting for filesystem::exists
* include/experimental/bits/fs_ops.h
(exists(const path&, error_code&)): Clear error if status is known
(LWG 2725).
(status(const path&, error_code&)): Handle EOVERFLOW.
* testsuite/experimental/filesystem/operations/exists.cc: Test
overload taking an error_code.
From-SVN: r241417
Diffstat (limited to 'libstdc++-v3/src')
-rw-r--r-- | libstdc++-v3/src/filesystem/ops.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libstdc++-v3/src/filesystem/ops.cc b/libstdc++-v3/src/filesystem/ops.cc index 659cfbb..6b38584 100644 --- a/libstdc++-v3/src/filesystem/ops.cc +++ b/libstdc++-v3/src/filesystem/ops.cc @@ -1297,7 +1297,7 @@ fs::space(const path& p, error_code& ec) noexcept #ifdef _GLIBCXX_HAVE_SYS_STAT_H fs::file_status -fs::status(const fs::path& p, std::error_code& ec) noexcept +fs::status(const fs::path& p, error_code& ec) noexcept { file_status status; stat_type st; @@ -1307,6 +1307,10 @@ fs::status(const fs::path& p, std::error_code& ec) noexcept ec.assign(err, std::generic_category()); if (is_not_found_errno(err)) status.type(file_type::not_found); +#ifdef EOVERFLOW + else if (err == EOVERFLOW) + status.type(file_type::unknown); +#endif } else { |