[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 a04ceb6ad42eefa2465cde69c73ff64ccea92f50..d1c6ced4b2e38e79f6784b0539de6a0fb6940dee 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 e2a61591ad2b5cd664365b12a53bada4e82ea8b8..090cbd8d864d5c57cefdbfd789b25571a7933ae5 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 5ad81863d4d8253f99f16ac23fc6c9f56b1ff479..2e222974b326edf1559562629bdddc15934ca95f 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 53af2c764c005a4a30b6663259d5de3a28c1c207..72d57449505bd10f8152f3a7d63d429a355670ce 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 a0d99c76d0723520326c50a33bfd40c1ce5ebb06..b15f1da0bd00255fff902469b8fb64dbc840c03f 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 54b25ac5589ac32d9382abc01ebdf90d5365d514..ae801857c923217d4c3a43e5512d5acf76a0ad36 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;
 }