2017-10-27 Jonathan Wakely <jwakely@redhat.com>
+ * include/bits/fs_dir.h (directory_iterator): Remove noexcept from
+ constructors and increment member (LWG 3013).
+ (recursive_directory_iterator): Likewise.
+ * include/bits/fs_ops.h (copy, copy_file, create_directories)
+ (is_empty, remove_all): Remove noexcept (LWG 3013 and LWG 3014).
+ * src/filesystem/std-dir.cc (directory_iterator::increment)
+ (recursive_directory_iterator::increment): Remove noexcept.
+ * src/filesystem/std-ops.cc (copy, copy_file, create_directories)
+ (is_empty, remove_all): Remove noexcept
+
* include/bits/fs_dir.h (file_status): Make default constructor
non-explicit (LWG 2787).
* testsuite/27_io/filesystem/file_status/1.cc: New test.
directory_iterator(const path& __p, directory_options __options)
: directory_iterator(__p, __options, nullptr) { }
- directory_iterator(const path& __p, error_code& __ec) noexcept
+ directory_iterator(const path& __p, error_code& __ec)
: directory_iterator(__p, directory_options::none, __ec) { }
- directory_iterator(const path& __p,
- directory_options __options,
- error_code& __ec) noexcept
+ directory_iterator(const path& __p, directory_options __options,
+ error_code& __ec)
: directory_iterator(__p, __options, &__ec) { }
directory_iterator(const directory_iterator& __rhs) = default;
const directory_entry& operator*() const;
const directory_entry* operator->() const { return &**this; }
directory_iterator& operator++();
- directory_iterator& increment(error_code& __ec) noexcept;
+ directory_iterator& increment(error_code& __ec);
__directory_iterator_proxy operator++(int)
{
recursive_directory_iterator(const path& __p, directory_options __options)
: recursive_directory_iterator(__p, __options, nullptr) { }
- recursive_directory_iterator(const path& __p,
- directory_options __options,
- error_code& __ec) noexcept
+ recursive_directory_iterator(const path& __p, directory_options __options,
+ error_code& __ec)
: recursive_directory_iterator(__p, __options, &__ec) { }
- recursive_directory_iterator(const path& __p, error_code& __ec) noexcept
+ recursive_directory_iterator(const path& __p, error_code& __ec)
: recursive_directory_iterator(__p, directory_options::none, &__ec) { }
recursive_directory_iterator(
operator=(recursive_directory_iterator&& __rhs) noexcept;
recursive_directory_iterator& operator++();
- recursive_directory_iterator& increment(error_code& __ec) noexcept;
+ recursive_directory_iterator& increment(error_code& __ec);
__directory_iterator_proxy operator++(int)
{
{ copy(__from, __to, copy_options::none); }
inline void
- copy(const path& __from, const path& __to, error_code& __ec) noexcept
+ copy(const path& __from, const path& __to, error_code& __ec)
{ copy(__from, __to, copy_options::none, __ec); }
void copy(const path& __from, const path& __to, copy_options __options);
void copy(const path& __from, const path& __to, copy_options __options,
- error_code& __ec) noexcept;
+ error_code& __ec);
inline bool
copy_file(const path& __from, const path& __to)
{ return copy_file(__from, __to, copy_options::none); }
inline bool
- copy_file(const path& __from, const path& __to, error_code& __ec) noexcept
+ copy_file(const path& __from, const path& __to, error_code& __ec)
{ return copy_file(__from, __to, copy_options::none, __ec); }
bool copy_file(const path& __from, const path& __to, copy_options __option);
bool copy_file(const path& __from, const path& __to, copy_options __option,
- error_code& __ec) noexcept;
+ error_code& __ec);
void copy_symlink(const path& __existing_symlink, const path& __new_symlink);
void copy_symlink(const path& __existing_symlink, const path& __new_symlink,
error_code& __ec) noexcept;
bool create_directories(const path& __p);
- bool create_directories(const path& __p, error_code& __ec) noexcept;
+ bool create_directories(const path& __p, error_code& __ec);
bool create_directory(const path& __p);
bool create_directory(const path& __p, error_code& __ec) noexcept;
{ return is_directory(status(__p, __ec)); }
bool is_empty(const path& __p);
- bool is_empty(const path& __p, error_code& __ec) noexcept;
+ bool is_empty(const path& __p, error_code& __ec);
inline bool
is_fifo(file_status __s) noexcept
bool remove(const path& __p, error_code& __ec) noexcept;
uintmax_t remove_all(const path& __p);
- uintmax_t remove_all(const path& __p, error_code& __ec) noexcept;
+ uintmax_t remove_all(const path& __p, error_code& __ec);
void rename(const path& __from, const path& __to);
void rename(const path& __from, const path& __to, error_code& __ec) noexcept;
}
fs::directory_iterator&
-fs::directory_iterator::increment(error_code& ec) noexcept
+fs::directory_iterator::increment(error_code& ec)
{
if (!_M_dir)
{
}
fs::recursive_directory_iterator&
-fs::recursive_directory_iterator::increment(error_code& ec) noexcept
+fs::recursive_directory_iterator::increment(error_code& ec)
{
if (!_M_dirs)
{
void
fs::copy(const path& from, const path& to, copy_options options,
- error_code& ec) noexcept
+ error_code& ec)
{
const bool skip_symlinks = is_set(options, copy_options::skip_symlinks);
const bool create_symlinks = is_set(options, copy_options::create_symlinks);
bool
fs::copy_file(const path& from, const path& to, copy_options options,
- error_code& ec) noexcept
+ error_code& ec)
{
#ifdef _GLIBCXX_HAVE_SYS_STAT_H
return do_copy_file(from.c_str(), to.c_str(), copy_file_options(options),
}
bool
-fs::create_directories(const path& p, error_code& ec) noexcept
+fs::create_directories(const path& p, error_code& ec)
{
if (p.empty())
{
}
bool
-fs::is_empty(const path& p, error_code& ec) noexcept
+fs::is_empty(const path& p, error_code& ec)
{
auto s = status(p, ec);
if (ec)
}
std::uintmax_t
-fs::remove_all(const path& p, error_code& ec) noexcept
+fs::remove_all(const path& p, error_code& ec)
{
auto fs = symlink_status(p, ec);
uintmax_t count = 0;