diff options
author | Eric Fiselier <eric@efcs.ca> | 2017-10-30 18:59:59 +0000 |
---|---|---|
committer | Eric Fiselier <eric@efcs.ca> | 2017-10-30 18:59:59 +0000 |
commit | ddfdb32b302da2cf1b20d4c64444f9f58d5b8533 (patch) | |
tree | 829ddc8147e26bcb681722d8a9f2fe8bf1f34dd2 /libcxx/include/experimental/filesystem | |
parent | b81fbf44c7b0f8273210ef8aa34b5fefa4359dc4 (diff) | |
download | bcm5719-llvm-ddfdb32b302da2cf1b20d4c64444f9f58d5b8533.tar.gz bcm5719-llvm-ddfdb32b302da2cf1b20d4c64444f9f58d5b8533.zip |
Implement LWG 3013 - some filesystem members should not be noexcept.
LWG 3013 points out that the constructors and increment members
of the directory iterators need to allocate, and therefore cannot
be marked noexcept.
It also points out that `is_empty` and `copy` likely need to allocate
as well, and as such can also not be noexcept.
This patch speculatively implements the resolution removing noexcept,
because libc++ does indeed have the possibility of throwing on allocation
failure.
llvm-svn: 316941
Diffstat (limited to 'libcxx/include/experimental/filesystem')
-rw-r--r-- | libcxx/include/experimental/filesystem | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/libcxx/include/experimental/filesystem b/libcxx/include/experimental/filesystem index 42157ba309b..747f62f2268 100644 --- a/libcxx/include/experimental/filesystem +++ b/libcxx/include/experimental/filesystem @@ -81,10 +81,10 @@ path canonical(const path& p, const path& base, error_code& ec); void copy(const path& from, const path& to); - void copy(const path& from, const path& to, error_code& ec) _NOEXCEPT; + void copy(const path& from, const path& to, error_code& 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); bool copy_file(const path& from, const path& to); bool copy_file(const path& from, const path& to, error_code& ec) _NOEXCEPT; @@ -1351,7 +1351,7 @@ void copy(const path& __from, const path& __to) { } inline _LIBCPP_INLINE_VISIBILITY -void copy(const path& __from, const path& __to, error_code& __ec) _NOEXCEPT { +void copy(const path& __from, const path& __to, error_code& __ec) { __copy(__from, __to, copy_options::none, &__ec); } @@ -1362,7 +1362,7 @@ void copy(const path& __from, const path& __to, copy_options __opt) { inline _LIBCPP_INLINE_VISIBILITY void copy(const path& __from, const path& __to, - copy_options __opt, error_code& __ec) _NOEXCEPT { + copy_options __opt, error_code& __ec) { __copy(__from, __to, __opt, &__ec); } @@ -1561,7 +1561,7 @@ bool is_empty(const path& __p) { } inline _LIBCPP_INLINE_VISIBILITY -bool is_empty(const path& __p, error_code& __ec) _NOEXCEPT { +bool is_empty(const path& __p, error_code& __ec) { return __fs_is_empty(__p, &__ec); } @@ -1903,12 +1903,12 @@ public: : directory_iterator(__p, nullptr, __opts) { } - directory_iterator(const path& __p, error_code& __ec) _NOEXCEPT + directory_iterator(const path& __p, error_code& __ec) : directory_iterator(__p, &__ec) { } directory_iterator(const path& __p, directory_options __opts, - error_code& __ec) _NOEXCEPT + error_code& __ec) : directory_iterator(__p, &__ec, __opts) { } @@ -1943,7 +1943,7 @@ public: return __p; } - directory_iterator& increment(error_code& __ec) _NOEXCEPT + directory_iterator& increment(error_code& __ec) { return __increment(&__ec); } private: @@ -2013,12 +2013,12 @@ public: _LIBCPP_INLINE_VISIBILITY recursive_directory_iterator(const path& __p, - directory_options __xoptions, error_code& __ec) _NOEXCEPT + directory_options __xoptions, error_code& __ec) : recursive_directory_iterator(__p, __xoptions, &__ec) { } _LIBCPP_INLINE_VISIBILITY - 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) { } @@ -2060,7 +2060,7 @@ public: } _LIBCPP_INLINE_VISIBILITY - recursive_directory_iterator& increment(error_code& __ec) _NOEXCEPT + recursive_directory_iterator& increment(error_code& __ec) { return __increment(&__ec); } _LIBCPP_FUNC_VIS directory_options options() const; |