diff --git a/libstdc++-v3/src/c++17/fs_dir.cc b/libstdc++-v3/src/c++17/fs_dir.cc index 784df2de53f..4932330de52 100644 --- a/libstdc++-v3/src/c++17/fs_dir.cc +++ b/libstdc++-v3/src/c++17/fs_dir.cc @@ -148,12 +148,8 @@ directory_iterator(const path& p, directory_options options, error_code* ecptr) } const fs::directory_entry& -fs::directory_iterator::operator*() const +fs::directory_iterator::operator*() const noexcept { - if (!_M_dir) - _GLIBCXX_THROW_OR_ABORT(filesystem_error( - "non-dereferenceable directory iterator", - std::make_error_code(errc::invalid_argument))); return _M_dir->entry; }