Эх сурвалжийг харах

[libcxx] [test] Revert r356632 add (void) casts to operator new calls, to suppress warnings generated by [[nodiscard]]."

git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@356635 91177308-0d34-0410-b5e6-96231b3b80d8
Billy Robert O'Neal III 6 жил өмнө
parent
commit
3fd12d449b

+ 1 - 1
test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.sh.cpp

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

+ 1 - 1
test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.sh.cpp

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

+ 1 - 1
test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.sh.cpp

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

+ 1 - 1
test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.sh.cpp

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

+ 1 - 1
test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.sh.cpp

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

+ 1 - 1
test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.sh.cpp

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