[libcxx] [test] Add (void) return casts on functions marked nodiscard in MS STL

Differential Revision: https://reviews.llvm.org/D89533
This commit is contained in:
Martin Storsjö 2020-10-14 13:14:18 +03:00
parent 66427d7359
commit ddb4693a92
4 changed files with 5 additions and 5 deletions

View File

@ -98,7 +98,7 @@ TEST_CASE(test_exception_contains_paths)
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 @@ TEST_CASE(test_exception_contains_paths)
}
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);

View File

@ -101,7 +101,7 @@ TEST_CASE(test_attributes_get_copied) {
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();

View File

@ -41,7 +41,7 @@ TEST_CASE(test_error_reporting)
{
#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

View File

@ -49,7 +49,7 @@ TEST_CASE(test_error_reporting)
{
#ifndef TEST_HAS_NO_EXCEPTIONS
try {
space(f);
(void)space(f);
return false;
} catch (filesystem_error const& err) {
return err.path1() == f