From 044b04348cfdc12848f1c6d5a8f45087c3075390 Mon Sep 17 00:00:00 2001 From: Jonathan Wakely Date: Tue, 27 Oct 2020 14:49:37 +0000 Subject: [PATCH] libstdc++: Fix directory_iterator exception specification libstdc++-v3/ChangeLog: * src/c++17/fs_dir.cc (fs::directory_iterator::operator*): Add noexcept. Do not throw on precondition violation. --- libstdc++-v3/src/c++17/fs_dir.cc | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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; } -- 2.30.2