diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2016-10-24 17:45:45 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2016-10-24 17:45:45 +0100 |
commit | bb52a7e324258d55eef28d2b1c473b3973507da2 (patch) | |
tree | b0a81fd73f5641a0b09b1bf140fb87f20759da78 /libstdc++-v3/testsuite/experimental/filesystem/iterators/recursive_directory_iterator.cc | |
parent | cfef9c1ea79749cb3fc40b3ef869a29470c6073c (diff) | |
download | gcc-bb52a7e324258d55eef28d2b1c473b3973507da2.tar.gz |
Make directory iterators become end iterator on error
* src/filesystem/dir.cc (open_dir): Return same value for errors
whether ignored or not.
(_Dir::advance(error_code*, directory_options)): Return false on
error.
(directory_iterator(const path&, directory_options, error_code*)):
Create end iterator on error (LWG 2723).
(recursive_directory_iterator(const path&, directory_options,
error_code*)): Likewise.
* testsuite/experimental/filesystem/iterators/directory_iterator.cc:
Update expected behaviour on error.
* testsuite/experimental/filesystem/iterators/
recursive_directory_iterator.cc: Likewise.
From-SVN: r241486
Diffstat (limited to 'libstdc++-v3/testsuite/experimental/filesystem/iterators/recursive_directory_iterator.cc')
-rw-r--r-- | libstdc++-v3/testsuite/experimental/filesystem/iterators/recursive_directory_iterator.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libstdc++-v3/testsuite/experimental/filesystem/iterators/recursive_directory_iterator.cc b/libstdc++-v3/testsuite/experimental/filesystem/iterators/recursive_directory_iterator.cc index 37b26066774..b41c394b41a 100644 --- a/libstdc++-v3/testsuite/experimental/filesystem/iterators/recursive_directory_iterator.cc +++ b/libstdc++-v3/testsuite/experimental/filesystem/iterators/recursive_directory_iterator.cc @@ -34,7 +34,7 @@ test01() const auto p = __gnu_test::nonexistent_path(); fs::recursive_directory_iterator iter(p, ec); VERIFY( ec ); - VERIFY( iter != fs::recursive_directory_iterator() ); + VERIFY( iter == fs::recursive_directory_iterator() ); // Test empty directory. create_directory(p, fs::current_path(), ec); @@ -60,7 +60,7 @@ test01() VERIFY( !ec ); iter = fs::recursive_directory_iterator(p, ec); VERIFY( ec ); - VERIFY( iter != fs::recursive_directory_iterator() ); + VERIFY( iter == fs::recursive_directory_iterator() ); // Test inaccessible directory, skipping permission denied. const auto opts = fs::directory_options::skip_permission_denied; |