[libcxx-commits] [PATCH] D89533: [libcxx] [test] Add (void) return casts on functions marked nodiscard in MS STL

Martin Storsjö via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Oct 16 07:37:54 PDT 2020


This revision was automatically updated to reflect the committed changes.
Closed by commit rGddb4693a92e7: [libcxx] [test] Add (void) return casts on functions marked nodiscard in MS STL (authored by mstorsjo).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89533/new/

https://reviews.llvm.org/D89533

Files:
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.canonical/canonical.pass.cpp
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp
  libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp


Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp
===================================================================
--- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp
+++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.space/space.pass.cpp
@@ -49,7 +49,7 @@
     {
 #ifndef TEST_HAS_NO_EXCEPTIONS
         try {
-            space(f);
+            (void)space(f);
             return false;
         } catch (filesystem_error const& err) {
             return err.path1() == f
Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp
===================================================================
--- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp
+++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.read_symlink/read_symlink.pass.cpp
@@ -41,7 +41,7 @@
     {
 #ifndef TEST_HAS_NO_EXCEPTIONS
         try {
-            fs::read_symlink(f);
+            (void)fs::read_symlink(f);
             return false;
         } catch (filesystem_error const& err) {
             return err.path1() == f
Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp
===================================================================
--- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp
+++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.copy_file/copy_file.pass.cpp
@@ -101,7 +101,7 @@
   scoped_test_env env;
   const path file = env.create_file("file1", 42);
   const path dest = env.make_env_path("file2");
-  auto st = status(file);
+  (void)status(file);
   perms new_perms = perms::owner_read;
   permissions(file, new_perms);
   std::error_code ec = GetTestEC();
Index: libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.canonical/canonical.pass.cpp
===================================================================
--- libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.canonical/canonical.pass.cpp
+++ libcxx/test/std/input.output/filesystems/fs.op.funcs/fs.op.canonical/canonical.pass.cpp
@@ -98,7 +98,7 @@
     CWDGuard guard;
     const path p = "blabla/dne";
     try {
-        canonical(p);
+        (void)canonical(p);
         TEST_REQUIRE(false);
     } catch (filesystem_error const& err) {
         TEST_CHECK(err.path1() == p);
@@ -107,7 +107,7 @@
     }
     fs::current_path(static_env.Dir);
     try {
-        canonical(p);
+        (void)canonical(p);
         TEST_REQUIRE(false);
     } catch (filesystem_error const& err) {
         TEST_CHECK(err.path1() == p);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D89533.298632.patch
Type: text/x-patch
Size: 2675 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20201016/31269f6e/attachment-0001.bin>


More information about the libcxx-commits mailing list