[libcxx] [test] Add (void) casts to operator new calls, to suppress warnings generate...
authorBilly Robert O'Neal III <bion@microsoft.com>
Wed, 20 Mar 2019 23:58:46 +0000 (23:58 +0000)
committerBilly Robert O'Neal III <bion@microsoft.com>
Wed, 20 Mar 2019 23:58:46 +0000 (23:58 +0000)
This allows these tests to pass when compiled by MSVC++.

llvm-svn: 356632

libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.sh.cpp
libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.sh.cpp
libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.sh.cpp
libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.sh.cpp
libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.sh.cpp
libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.sh.cpp

index a04ceb6..d1c6ced 100644 (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;
 }
index e2a6159..090cbd8 100644 (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;
 }
index 5ad8186..2e22297 100644 (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;
 }
index 53af2c7..72d5744 100644 (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;
 }
index a0d99c7..b15f1da 100644 (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;
 }
index 54b25ac..ae80185 100644 (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;
 }