Author: ericwf Date: Sat Feb 3 23:35:36 2018 New Revision: 324192 URL: http://llvm.org/viewvc/llvm-project?rev=324192&view=rev Log: Implement LWG 3014 - Fix more noexcept issues in filesystem.
This patch removes the noexcept declaration from filesystem operations which require creating temporary paths or creating a directory iterator. Either of these operations can throw. Modified: libcxx/trunk/include/experimental/filesystem libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp libcxx/trunk/www/upcoming_meeting.html Modified: libcxx/trunk/include/experimental/filesystem URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/experimental/filesystem?rev=324192&r1=324191&r2=324192&view=diff ============================================================================== --- libcxx/trunk/include/experimental/filesystem (original) +++ libcxx/trunk/include/experimental/filesystem Sat Feb 3 23:35:36 2018 @@ -88,17 +88,17 @@ 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; + bool copy_file(const path& from, const path& to, error_code& 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; @@ -188,7 +188,7 @@ 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; @@ -1375,7 +1375,7 @@ bool copy_file(const path& __from, const } inline _LIBCPP_INLINE_VISIBILITY -bool copy_file(const path& __from, const path& __to, error_code& __ec) _NOEXCEPT { +bool copy_file(const path& __from, const path& __to, error_code& __ec) { return __copy_file(__from, __to, copy_options::none, &__ec); } @@ -1386,7 +1386,7 @@ bool copy_file(const path& __from, const inline _LIBCPP_INLINE_VISIBILITY bool copy_file(const path& __from, const path& __to, - copy_options __opt, error_code& __ec) _NOEXCEPT { + copy_options __opt, error_code& __ec){ return __copy_file(__from, __to, __opt, &__ec); } @@ -1406,7 +1406,7 @@ bool create_directories(const path& __p) } inline _LIBCPP_INLINE_VISIBILITY -bool create_directories(const path& __p, error_code& __ec) _NOEXCEPT { +bool create_directories(const path& __p, error_code& __ec) { return __create_directories(__p, &__ec); } @@ -1699,7 +1699,7 @@ uintmax_t remove_all(const path& __p) { } inline _LIBCPP_INLINE_VISIBILITY -uintmax_t remove_all(const path& __p, error_code& __ec) _NOEXCEPT { +uintmax_t remove_all(const path& __p, error_code& __ec) { return __remove_all(__p, &__ec); } Modified: libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp?rev=324192&r1=324191&r2=324192&view=diff ============================================================================== --- libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp (original) +++ libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp Sat Feb 3 23:35:36 2018 @@ -44,8 +44,8 @@ TEST_CASE(test_signatures) ASSERT_SAME_TYPE(decltype(fs::copy_file(p, p, opts, ec)), bool); ASSERT_NOT_NOEXCEPT(fs::copy_file(p, p)); ASSERT_NOT_NOEXCEPT(fs::copy_file(p, p, opts)); - ASSERT_NOEXCEPT(fs::copy_file(p, p, ec)); - ASSERT_NOEXCEPT(fs::copy_file(p, p, opts, ec)); + ASSERT_NOT_NOEXCEPT(fs::copy_file(p, p, ec)); + ASSERT_NOT_NOEXCEPT(fs::copy_file(p, p, opts, ec)); } TEST_CASE(test_error_reporting) Modified: libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp?rev=324192&r1=324191&r2=324192&view=diff ============================================================================== --- libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp (original) +++ libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.create_directories/create_directories.pass.cpp Sat Feb 3 23:35:36 2018 @@ -34,7 +34,7 @@ TEST_CASE(test_signatures) ASSERT_SAME_TYPE(decltype(fs::create_directories(p)), bool); ASSERT_SAME_TYPE(decltype(fs::create_directories(p, ec)), bool); ASSERT_NOT_NOEXCEPT(fs::create_directories(p)); - ASSERT_NOEXCEPT(fs::create_directories(p, ec)); + ASSERT_NOT_NOEXCEPT(fs::create_directories(p, ec)); } TEST_CASE(create_existing_directory) Modified: libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp?rev=324192&r1=324191&r2=324192&view=diff ============================================================================== --- libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp (original) +++ libcxx/trunk/test/std/experimental/filesystem/fs.op.funcs/fs.op.remove_all/remove_all.pass.cpp Sat Feb 3 23:35:36 2018 @@ -33,7 +33,7 @@ TEST_CASE(test_signatures) ASSERT_SAME_TYPE(decltype(fs::remove_all(p, ec)), std::uintmax_t); ASSERT_NOT_NOEXCEPT(fs::remove_all(p)); - ASSERT_NOEXCEPT(fs::remove_all(p, ec)); + ASSERT_NOT_NOEXCEPT(fs::remove_all(p, ec)); } TEST_CASE(test_error_reporting) Modified: libcxx/trunk/www/upcoming_meeting.html URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/www/upcoming_meeting.html?rev=324192&r1=324191&r2=324192&view=diff ============================================================================== --- libcxx/trunk/www/upcoming_meeting.html (original) +++ libcxx/trunk/www/upcoming_meeting.html Sat Feb 3 23:35:36 2018 @@ -76,7 +76,7 @@ <tr><td><a href="https://wg21.link/LWG3009">3009</a></td><td>Including <tt><string_view></tt> doesn't provide <tt>std::size/empty/data</tt></td><td>Jacksonville</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG3010">3010</a></td><td>[networking.ts] <tt>uses_executor</tt> says "if a type <tt>T::executor_type</tt> exists"</td><td>Jacksonville</td><td></td></tr> <tr><td><a href="https://wg21.link/LWG3013">3013</a></td><td><tt>(recursive_)directory_iterator</tt> construction and traversal should not be <tt>noexcept</tt></td><td>Jacksonville</td><td>Complete</td></tr> -<tr><td><a href="https://wg21.link/LWG3014">3014</a></td><td>More <tt>noexcept</tt> issues with filesystem operations</td><td>Jacksonville</td><td></td></tr> +<tr><td><a href="https://wg21.link/LWG3014">3014</a></td><td>More <tt>noexcept</tt> issues with filesystem operations</td><td>Jacksonville</td><td>Complete</td></tr> <tr><td><a href="https://wg21.link/LWG3015">3015</a></td><td><tt>copy_options::<i>unspecified</i></tt> underspecified</td><td>Jacksonville</td><td></td></tr> <tr><td><a href="https://wg21.link/LWG3017">3017</a></td><td><tt>list splice</tt> functions should use <tt>addressof</tt></td><td>Jacksonville</td><td></td></tr> <tr><td><a href="https://wg21.link/LWG3020">3020</a></td><td>[networking.ts] Remove spurious nested <tt>value_type</tt> buffer sequence requirement</td><td>Jacksonville</td><td></td></tr> @@ -113,7 +113,7 @@ <li> 3009 - We do this already; tests added in r323719</li> <li> 3010 - No networking TS implementation yet</li> <li> 3013 - We already implement this</li> -<li> 3014 - Eric? </li> +<li> 3014 - We implement this</li> <li> 3015 - Eric? </li> <li> 3017 - We don't do the splicing stuff yet</li> <li> 3020 - No networking TS implementation yet</li> _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits