[libcxx-commits] [libcxx] r356632 - [libcxx] [test] Add (void) casts to operator new calls, to suppress warnings generated by [[nodiscard]].
Billy Robert O'Neal III via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Mar 20 16:58:47 PDT 2019
Author: bion
Date: Wed Mar 20 16:58:46 2019
New Revision: 356632
URL: http://llvm.org/viewvc/llvm-project?rev=356632&view=rev
Log:
[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++.
Modified:
libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.sh.cpp
libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.sh.cpp
libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.sh.cpp
libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.sh.cpp
libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.sh.cpp
libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.sh.cpp
Modified: libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.sh.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.sh.cpp?rev=356632&r1=356631&r2=356632&view=diff
==============================================================================
--- libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.sh.cpp (original)
+++ libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size.sh.cpp Wed Mar 20 16:58:46 2019
@@ -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;
}
Modified: libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.sh.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.sh.cpp?rev=356632&r1=356631&r2=356632&view=diff
==============================================================================
--- libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.sh.cpp (original)
+++ libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align.sh.cpp Wed Mar 20 16:58:46 2019
@@ -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;
}
Modified: libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.sh.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.sh.cpp?rev=356632&r1=356631&r2=356632&view=diff
==============================================================================
--- libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.sh.cpp (original)
+++ libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_align_nothrow.sh.cpp Wed Mar 20 16:58:46 2019
@@ -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;
}
Modified: libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.sh.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.sh.cpp?rev=356632&r1=356631&r2=356632&view=diff
==============================================================================
--- libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.sh.cpp (original)
+++ libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.array/new_size_nothrow.sh.cpp Wed Mar 20 16:58:46 2019
@@ -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;
}
Modified: libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.sh.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.sh.cpp?rev=356632&r1=356631&r2=356632&view=diff
==============================================================================
--- libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.sh.cpp (original)
+++ libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align.sh.cpp Wed Mar 20 16:58:46 2019
@@ -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;
}
Modified: libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.sh.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.sh.cpp?rev=356632&r1=356631&r2=356632&view=diff
==============================================================================
--- libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.sh.cpp (original)
+++ libcxx/trunk/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_align_nothrow.sh.cpp Wed Mar 20 16:58:46 2019
@@ -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;
}
More information about the libcxx-commits
mailing list