public inbox for libstdc++@gcc.gnu.org
 help / color / mirror / Atom feed
* [committed] libstdc++: Fix directory_iterator exception specification
@ 2020-10-27 14:58 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2020-10-27 14:58 UTC (permalink / raw)
  To: libstdc++, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 183 bytes --]

libstdc++-v3/ChangeLog:

	* src/c++17/fs_dir.cc (fs::directory_iterator::operator*):
	Add noexcept. Do not throw on precondition violation.

Tested x86_64-linux. Committed to trunk.


[-- Attachment #2: patch.txt --]
[-- Type: text/plain, Size: 985 bytes --]

commit 044b04348cfdc12848f1c6d5a8f45087c3075390
Author: Jonathan Wakely <jwakely@redhat.com>
Date:   Tue Oct 27 14:49:37 2020

    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.

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;
 }
 

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-10-27 14:58 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-27 14:58 [committed] libstdc++: Fix directory_iterator exception specification Jonathan Wakely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).