[libcxx-commits] [libcxx] e2ddd51 - [libcxx] [test] Allow fs::permissions(path, perms, perm_options, error_code) to be noexcept

Martin Storsjö via libcxx-commits libcxx-commits at lists.llvm.org
Mon Oct 19 14:07:27 PDT 2020


Author: Martin Storsjö
Date: 2020-10-20T00:07:01+03:00
New Revision: e2ddd515abd1735a3a8c075f2e6e487872cb8a4f

URL: https://github.com/llvm/llvm-project/commit/e2ddd515abd1735a3a8c075f2e6e487872cb8a4f
DIFF: https://github.com/llvm/llvm-project/commit/e2ddd515abd1735a3a8c075f2e6e487872cb8a4f.diff

LOG: [libcxx] [test] Allow fs::permissions(path, perms, perm_options, error_code) to be noexcept

The standard doesn't declare this overload as noexcept, but doesn't
either say that it strictly cannot be noexcept either. The function
doesn't throw on errors that are signaled via error_code, but the
standard says that it may throw a bad_alloc.

This fixes an error with libstdc++ on linux.

Differential Revision: https://reviews.llvm.org/D89678

Added: 
    

Modified: 
    libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp
index 74406dc1deab..fe4ddee022a6 100644
--- a/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp
+++ b/libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.permissions/permissions.pass.cpp
@@ -38,7 +38,7 @@ TEST_CASE(test_signatures)
     ASSERT_NOT_NOEXCEPT(fs::permissions(p, pr));
     ASSERT_NOT_NOEXCEPT(fs::permissions(p, pr, opts));
     ASSERT_NOEXCEPT(fs::permissions(p, pr, ec));
-    ASSERT_NOT_NOEXCEPT(fs::permissions(p, pr, opts, ec));
+    LIBCPP_ONLY(ASSERT_NOT_NOEXCEPT(fs::permissions(p, pr, opts, ec)));
 }
 
 TEST_CASE(test_error_reporting)


        


More information about the libcxx-commits mailing list