[libcxx] [test] Add (void) casts to operator new calls, to suppress warnings generated by [[nodiscard]].

This allows these tests to pass when compiled by MSVC++.

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356632 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Billy Robert O'Neal III 2019-03-20 23:58:46 +00:00
parent c2cb7c6414
commit 82e238eecb
6 changed files with 6 additions and 6 deletions

View File

@ -21,7 +21,7 @@
int main(int, char**)
{
::operator new[](4); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
(void)::operator new[](4);
return 0;
}

View File

@ -21,7 +21,7 @@
int main(int, char**)
{
::operator new[](4, std::align_val_t{4}); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
(void)::operator new[](4, std::align_val_t{4});
return 0;
}

View File

@ -21,7 +21,7 @@
int main(int, char**)
{
::operator new[](4, std::align_val_t{4}, std::nothrow); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
(void)::operator new[](4, std::align_val_t{4}, std::nothrow);
return 0;
}

View File

@ -21,7 +21,7 @@
int main(int, char**)
{
::operator new[](4, std::nothrow); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
(void)::operator new[](4, std::nothrow);
return 0;
}

View File

@ -21,7 +21,7 @@
int main(int, char**)
{
::operator new(4, std::align_val_t{4}); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
(void)::operator new(4, std::align_val_t{4});
return 0;
}

View File

@ -21,7 +21,7 @@
int main(int, char**)
{
::operator new(4, std::align_val_t{4}, std::nothrow); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
(void)::operator new(4, std::align_val_t{4}, std::nothrow);
return 0;
}