Make directory iterators become end iterator on error
authorJonathan Wakely <jwakely@redhat.com>
Mon, 24 Oct 2016 16:45:45 +0000 (17:45 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Mon, 24 Oct 2016 16:45:45 +0000 (17:45 +0100)
commitbb52a7e324258d55eef28d2b1c473b3973507da2
treeb0a81fd73f5641a0b09b1bf140fb87f20759da78
parentcfef9c1ea79749cb3fc40b3ef869a29470c6073c
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
libstdc++-v3/ChangeLog
libstdc++-v3/src/filesystem/dir.cc
libstdc++-v3/testsuite/experimental/filesystem/iterators/directory_iterator.cc
libstdc++-v3/testsuite/experimental/filesystem/iterators/recursive_directory_iterator.cc