forked from OSchip/llvm-project
[libc++] Do not force the use of -Werror in verify tests
Forcing -Werror and other warnings means that the test suite isn't actually testing what most people are seeing in their code -- it seems better and less arbitrary to compile these tests as close as possible to the compiler default instead. Removing -Werror also means that we get to differentiate between diagnostics that are errors and those that are warnings, which makes the test suite more precise. Differential Revision: https://reviews.llvm.org/D76311
This commit is contained in:
parent
13dc21e841
commit
a5fa5f7cb8
|
@ -41,9 +41,9 @@ struct gen
|
|||
int main(int, char**)
|
||||
{
|
||||
int v[1] = {1};
|
||||
std::random_shuffle(&v[0], &v[1]); // expected-error{{'random_shuffle<int *>' is deprecated}}
|
||||
std::random_shuffle(&v[0], &v[1]); // expected-warning {{'random_shuffle<int *>' is deprecated}}
|
||||
gen r;
|
||||
std::random_shuffle(&v[0], &v[1], r); // expected-error{{'random_shuffle<int *, gen &>' is deprecated}}
|
||||
std::random_shuffle(&v[0], &v[1], r); // expected-warning {{'random_shuffle<int *, gen &>' is deprecated}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -30,9 +30,9 @@
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
typedef std::auto_ptr<int> AP; // expected-error{{'auto_ptr<int>' is deprecated}}
|
||||
typedef std::auto_ptr<void> APV; // expected-error{{'auto_ptr<void>' is deprecated}}
|
||||
typedef std::auto_ptr_ref<int> APR; // expected-error{{'auto_ptr_ref<int>' is deprecated}}
|
||||
typedef std::auto_ptr<int> AP; // expected-warning {{'auto_ptr<int>' is deprecated}}
|
||||
typedef std::auto_ptr<void> APV; // expected-warning {{'auto_ptr<void>' is deprecated}}
|
||||
typedef std::auto_ptr_ref<int> APR; // expected-warning {{'auto_ptr_ref<int>' is deprecated}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ int main(int, char**)
|
|||
int x = 0;
|
||||
std::allocator<int> a;
|
||||
|
||||
int* p = a.address(x); // expected-error{{'address' is deprecated}}
|
||||
int* p = a.address(x); // expected-warning {{'address' is deprecated}}
|
||||
(void)p;
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::allocator<int> a;
|
||||
a.allocate(3, nullptr); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
a.allocate(3, nullptr); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::allocator<int> a;
|
||||
TEST_IGNORE_NODISCARD a.allocate(3, nullptr); // expected-error {{'allocate' is deprecated}}
|
||||
TEST_IGNORE_NODISCARD a.allocate(3, nullptr); // expected-warning {{'allocate' is deprecated}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -42,13 +42,13 @@
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
typedef std::allocator<char>::size_type AST; // expected-error{{'size_type' is deprecated}}
|
||||
typedef std::allocator<char>::difference_type ADT; // expected-error{{'difference_type' is deprecated}}
|
||||
typedef std::allocator<char>::pointer AP; // expected-error{{'pointer' is deprecated}}
|
||||
typedef std::allocator<char>::const_pointer ACP; // expected-error{{'const_pointer' is deprecated}}
|
||||
typedef std::allocator<char>::reference AR; // expected-error{{'reference' is deprecated}}
|
||||
typedef std::allocator<char>::const_reference ACR; // expected-error{{'const_reference' is deprecated}}
|
||||
typedef std::allocator<char>::rebind<int>::other ARO; // expected-error{{'rebind<int>' is deprecated}}
|
||||
typedef std::allocator<char>::size_type AST; // expected-warning {{'size_type' is deprecated}}
|
||||
typedef std::allocator<char>::difference_type ADT; // expected-warning {{'difference_type' is deprecated}}
|
||||
typedef std::allocator<char>::pointer AP; // expected-warning {{'pointer' is deprecated}}
|
||||
typedef std::allocator<char>::const_pointer ACP; // expected-warning {{'const_pointer' is deprecated}}
|
||||
typedef std::allocator<char>::reference AR; // expected-warning {{'reference' is deprecated}}
|
||||
typedef std::allocator<char>::const_reference ACR; // expected-warning {{'const_reference' is deprecated}}
|
||||
typedef std::allocator<char>::rebind<int>::other ARO; // expected-warning {{'rebind<int>' is deprecated}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -32,9 +32,9 @@
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
typedef std::allocator<void>::pointer AP; // expected-error{{'allocator<void>' is deprecated}}
|
||||
typedef std::allocator<void>::const_pointer ACP; // expected-error{{'allocator<void>' is deprecated}}
|
||||
typedef std::allocator<void>::rebind<int>::other ARO; // expected-error{{'allocator<void>' is deprecated}}
|
||||
typedef std::allocator<void>::pointer AP; // expected-warning {{'allocator<void>' is deprecated}}
|
||||
typedef std::allocator<void>::const_pointer ACP; // expected-warning {{'allocator<void>' is deprecated}}
|
||||
typedef std::allocator<void>::rebind<int>::other ARO; // expected-warning {{'allocator<void>' is deprecated}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -31,28 +31,28 @@ struct Foo {
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
typedef std::pointer_to_unary_function<int, int> PUF; // expected-error{{'pointer_to_unary_function<int, int>' is deprecated}}
|
||||
typedef std::pointer_to_binary_function<int, int, int> PBF; // expected-error{{'pointer_to_binary_function<int, int, int>' is deprecated}}
|
||||
std::ptr_fun<int, int>(identity); // expected-error{{'ptr_fun<int, int>' is deprecated}}
|
||||
std::ptr_fun<int, int, int>(sum); // expected-error{{'ptr_fun<int, int, int>' is deprecated}}
|
||||
typedef std::pointer_to_unary_function<int, int> PUF; // expected-warning {{'pointer_to_unary_function<int, int>' is deprecated}}
|
||||
typedef std::pointer_to_binary_function<int, int, int> PBF; // expected-warning {{'pointer_to_binary_function<int, int, int>' is deprecated}}
|
||||
std::ptr_fun<int, int>(identity); // expected-warning {{'ptr_fun<int, int>' is deprecated}}
|
||||
std::ptr_fun<int, int, int>(sum); // expected-warning {{'ptr_fun<int, int, int>' is deprecated}}
|
||||
|
||||
typedef std::mem_fun_t<int, Foo> MFT0; // expected-error{{'mem_fun_t<int, Foo>' is deprecated}}
|
||||
typedef std::mem_fun1_t<int, Foo, int> MFT1; // expected-error{{'mem_fun1_t<int, Foo, int>' is deprecated}}
|
||||
typedef std::const_mem_fun_t<int, Foo> CMFT0; // expected-error{{'const_mem_fun_t<int, Foo>' is deprecated}}
|
||||
typedef std::const_mem_fun1_t<int, Foo, int> CMFT1; // expected-error{{'const_mem_fun1_t<int, Foo, int>' is deprecated}}
|
||||
std::mem_fun<int, Foo>(&Foo::zero); // expected-error{{'mem_fun<int, Foo>' is deprecated}}
|
||||
std::mem_fun<int, Foo, int>(&Foo::identity); // expected-error{{'mem_fun<int, Foo, int>' is deprecated}}
|
||||
std::mem_fun<int, Foo>(&Foo::const_zero); // expected-error{{'mem_fun<int, Foo>' is deprecated}}
|
||||
std::mem_fun<int, Foo, int>(&Foo::const_identity); // expected-error{{'mem_fun<int, Foo, int>' is deprecated}}
|
||||
typedef std::mem_fun_t<int, Foo> MFT0; // expected-warning {{'mem_fun_t<int, Foo>' is deprecated}}
|
||||
typedef std::mem_fun1_t<int, Foo, int> MFT1; // expected-warning {{'mem_fun1_t<int, Foo, int>' is deprecated}}
|
||||
typedef std::const_mem_fun_t<int, Foo> CMFT0; // expected-warning {{'const_mem_fun_t<int, Foo>' is deprecated}}
|
||||
typedef std::const_mem_fun1_t<int, Foo, int> CMFT1; // expected-warning {{'const_mem_fun1_t<int, Foo, int>' is deprecated}}
|
||||
std::mem_fun<int, Foo>(&Foo::zero); // expected-warning {{'mem_fun<int, Foo>' is deprecated}}
|
||||
std::mem_fun<int, Foo, int>(&Foo::identity); // expected-warning {{'mem_fun<int, Foo, int>' is deprecated}}
|
||||
std::mem_fun<int, Foo>(&Foo::const_zero); // expected-warning {{'mem_fun<int, Foo>' is deprecated}}
|
||||
std::mem_fun<int, Foo, int>(&Foo::const_identity); // expected-warning {{'mem_fun<int, Foo, int>' is deprecated}}
|
||||
|
||||
typedef std::mem_fun_ref_t<int, Foo> MFR0; // expected-error{{'mem_fun_ref_t<int, Foo>' is deprecated}}
|
||||
typedef std::mem_fun1_ref_t<int, Foo, int> MFR1; // expected-error{{'mem_fun1_ref_t<int, Foo, int>' is deprecated}}
|
||||
typedef std::const_mem_fun_ref_t<int, Foo> CMFR0; // expected-error{{'const_mem_fun_ref_t<int, Foo>' is deprecated}}
|
||||
typedef std::const_mem_fun1_ref_t<int, Foo, int> CMFR1; // expected-error{{'const_mem_fun1_ref_t<int, Foo, int>' is deprecated}}
|
||||
std::mem_fun_ref<int, Foo>(&Foo::zero); // expected-error{{'mem_fun_ref<int, Foo>' is deprecated}}
|
||||
std::mem_fun_ref<int, Foo, int>(&Foo::identity); // expected-error{{'mem_fun_ref<int, Foo, int>' is deprecated}}
|
||||
std::mem_fun_ref<int, Foo>(&Foo::const_zero); // expected-error{{'mem_fun_ref<int, Foo>' is deprecated}}
|
||||
std::mem_fun_ref<int, Foo, int>(&Foo::const_identity); // expected-error{{'mem_fun_ref<int, Foo, int>' is deprecated}}
|
||||
typedef std::mem_fun_ref_t<int, Foo> MFR0; // expected-warning {{'mem_fun_ref_t<int, Foo>' is deprecated}}
|
||||
typedef std::mem_fun1_ref_t<int, Foo, int> MFR1; // expected-warning {{'mem_fun1_ref_t<int, Foo, int>' is deprecated}}
|
||||
typedef std::const_mem_fun_ref_t<int, Foo> CMFR0; // expected-warning {{'const_mem_fun_ref_t<int, Foo>' is deprecated}}
|
||||
typedef std::const_mem_fun1_ref_t<int, Foo, int> CMFR1; // expected-warning {{'const_mem_fun1_ref_t<int, Foo, int>' is deprecated}}
|
||||
std::mem_fun_ref<int, Foo>(&Foo::zero); // expected-warning {{'mem_fun_ref<int, Foo>' is deprecated}}
|
||||
std::mem_fun_ref<int, Foo, int>(&Foo::identity); // expected-warning {{'mem_fun_ref<int, Foo, int>' is deprecated}}
|
||||
std::mem_fun_ref<int, Foo>(&Foo::const_zero); // expected-warning {{'mem_fun_ref<int, Foo>' is deprecated}}
|
||||
std::mem_fun_ref<int, Foo, int>(&Foo::const_identity); // expected-warning {{'mem_fun_ref<int, Foo, int>' is deprecated}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -27,8 +27,8 @@ _LIBCPP_NODISCARD_EXT int foo() { return 42; }
|
|||
_LIBCPP_NODISCARD_AFTER_CXX17 int bar() { return 42; }
|
||||
|
||||
int main(int, char**) {
|
||||
foo(); // expected-error-re {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
bar(); // expected-error-re {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
foo(); // expected-warning-re {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
bar(); // expected-warning-re {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
(void)foo(); // OK. void casts disable the diagnostic.
|
||||
(void)bar();
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ _LIBCPP_NODISCARD_EXT int foo() { return 42; }
|
|||
_LIBCPP_NODISCARD_AFTER_CXX17 int bar() { return 42; }
|
||||
|
||||
int main(int, char**) {
|
||||
foo(); // expected-error-re {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
foo(); // expected-warning-re{{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
bar(); // OK.
|
||||
(void)foo(); // OK.
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ _LIBCPP_NODISCARD_EXT int foo() { return 42; }
|
|||
_LIBCPP_NODISCARD_AFTER_CXX17 int bar() { return 42; }
|
||||
|
||||
int main(int, char**) {
|
||||
bar(); // expected-error-re {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
bar(); // expected-warning-re{{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
foo(); // OK.
|
||||
(void)bar(); // OK.
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ _LIBCPP_NODISCARD_AFTER_CXX17 int foo() { return 6; }
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
foo(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
foo(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -38,260 +38,260 @@ struct P {
|
|||
int main(int, char**) {
|
||||
int arr[1] = { 1 };
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::adjacent_find(std::begin(arr), std::end(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::adjacent_find(std::begin(arr), std::end(arr), std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::all_of(std::begin(arr), std::end(arr), P());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::any_of(std::begin(arr), std::end(arr), P());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::binary_search(std::begin(arr), std::end(arr), 1);
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::binary_search(std::begin(arr), std::end(arr), 1, std::greater<int>());
|
||||
|
||||
#if TEST_STD_VER >= 17
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::clamp(2, 1, 3);
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::clamp(2, 1, 3, std::greater<int>());
|
||||
#endif
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::count_if(std::begin(arr), std::end(arr), P());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::count(std::begin(arr), std::end(arr), 1);
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::equal_range(std::begin(arr), std::end(arr), 1);
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::equal_range(std::begin(arr), std::end(arr), 1, std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::equal(std::begin(arr), std::end(arr), std::begin(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::equal(std::begin(arr), std::end(arr), std::begin(arr),
|
||||
std::greater<int>());
|
||||
|
||||
#if TEST_STD_VER >= 14
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::equal(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::equal(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr),
|
||||
std::greater<int>());
|
||||
#endif
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::find_end(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::find_end(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr),
|
||||
std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::find_first_of(std::begin(arr), std::end(arr), std::begin(arr),
|
||||
std::end(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::find_first_of(std::begin(arr), std::end(arr), std::begin(arr),
|
||||
std::end(arr), std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::find_if_not(std::begin(arr), std::end(arr), P());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::find_if(std::begin(arr), std::end(arr), P());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::find(std::begin(arr), std::end(arr), 1);
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::get_temporary_buffer<int>(1);
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::includes(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::includes(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr),
|
||||
std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::is_heap_until(std::begin(arr), std::end(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::is_heap_until(std::begin(arr), std::end(arr), std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::is_heap(std::begin(arr), std::end(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::is_heap(std::begin(arr), std::end(arr), std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::is_partitioned(std::begin(arr), std::end(arr), P());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::is_permutation(std::begin(arr), std::end(arr), std::begin(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::is_permutation(std::begin(arr), std::end(arr), std::begin(arr),
|
||||
std::greater<int>());
|
||||
|
||||
#if TEST_STD_VER >= 14
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::is_permutation(std::begin(arr), std::end(arr), std::begin(arr),
|
||||
std::end(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::is_permutation(std::begin(arr), std::end(arr), std::begin(arr),
|
||||
std::end(arr), std::greater<int>());
|
||||
#endif
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::is_sorted_until(std::begin(arr), std::end(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::is_sorted_until(std::begin(arr), std::end(arr), std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::is_sorted(std::begin(arr), std::end(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::is_sorted(std::begin(arr), std::end(arr), std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::lexicographical_compare(std::begin(arr), std::end(arr), std::begin(arr),
|
||||
std::end(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::lexicographical_compare(std::begin(arr), std::end(arr), std::begin(arr),
|
||||
std::end(arr), std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::lower_bound(std::begin(arr), std::end(arr), 1);
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::lower_bound(std::begin(arr), std::end(arr), 1, std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::max_element(std::begin(arr), std::end(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::max_element(std::begin(arr), std::end(arr), std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::max(1, 2);
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::max(1, 2, std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::max({1, 2, 3});
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::max({1, 2, 3}, std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::min_element(std::begin(arr), std::end(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::min_element(std::begin(arr), std::end(arr), std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::min(1, 2);
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::min(1, 2, std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::min({1, 2, 3});
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::min({1, 2, 3}, std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::minmax_element(std::begin(arr), std::end(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::minmax_element(std::begin(arr), std::end(arr), std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::minmax(1, 2);
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::minmax(1, 2, std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::minmax({1, 2, 3});
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::minmax({1, 2, 3}, std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::mismatch(std::begin(arr), std::end(arr), std::begin(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::mismatch(std::begin(arr), std::end(arr), std::begin(arr),
|
||||
std::greater<int>());
|
||||
|
||||
#if TEST_STD_VER >= 14
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::mismatch(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::mismatch(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr),
|
||||
std::greater<int>());
|
||||
#endif
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::none_of(std::begin(arr), std::end(arr), P());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::remove_if(std::begin(arr), std::end(arr), P());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::remove(std::begin(arr), std::end(arr), 1);
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::search_n(std::begin(arr), std::end(arr), 1, 1);
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::search_n(std::begin(arr), std::end(arr), 1, 1, std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::search(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::search(std::begin(arr), std::end(arr), std::begin(arr), std::end(arr),
|
||||
std::greater<int>());
|
||||
|
||||
#if TEST_STD_VER >= 17
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::search(std::begin(arr), std::end(arr),
|
||||
std::default_searcher(std::begin(arr), std::end(arr)));
|
||||
#endif
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::unique(std::begin(arr), std::end(arr));
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::unique(std::begin(arr), std::end(arr), std::greater<int>());
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::upper_bound(std::begin(arr), std::end(arr), 1);
|
||||
|
||||
// expected-error-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
// expected-warning-re@+1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
|
||||
std::upper_bound(std::begin(arr), std::end(arr), 1, std::greater<int>());
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include <experimental/filesystem>
|
||||
|
||||
using namespace std::experimental::filesystem; // expected-error {{'filesystem' is deprecated: std::experimental::filesystem has now been deprecated in favor of C++17's std::filesystem. Please stop using it and start using std::filesystem. This experimental version will be removed in LLVM 11. You can remove this warning by defining the _LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM macro.}}
|
||||
using namespace std::experimental::filesystem; // expected-warning {{'filesystem' is deprecated: std::experimental::filesystem has now been deprecated in favor of C++17's std::filesystem. Please stop using it and start using std::filesystem. This experimental version will be removed in LLVM 11. You can remove this warning by defining the _LIBCPP_NO_EXPERIMENTAL_DEPRECATION_WARNING_FILESYSTEM macro.}}
|
||||
|
||||
int main(int, char**) {
|
||||
return 0;
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
|
||||
int main(int, char**) {
|
||||
std::mutex m;
|
||||
std::lock_guard<std::mutex>{m}; // expected-error{{ignoring temporary created by a constructor declared with 'nodiscard' attribute}}
|
||||
std::lock_guard<std::mutex>{m, std::adopt_lock}; // expected-error{{ignoring temporary created by a constructor declared with 'nodiscard' attribute}}
|
||||
std::lock_guard<std::mutex>{m}; // expected-warning {{ignoring temporary created by a constructor declared with 'nodiscard' attribute}}
|
||||
std::lock_guard<std::mutex>{m, std::adopt_lock}; // expected-warning {{ignoring temporary created by a constructor declared with 'nodiscard' attribute}}
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -20,10 +20,10 @@
|
|||
int main() {
|
||||
// Note:
|
||||
// We use sizeof() to require it to be a complete type. We don't create a
|
||||
// variable because otherwise we get two errors for each variable (the
|
||||
// second error is when the destructor is implicitly called).
|
||||
(void)sizeof(std::function<void ()>); // expected-error{{'function<void ()>' is deprecated}}
|
||||
(void)sizeof(std::function<void (int)>); // expected-error{{'function<void (int)>' is deprecated}}
|
||||
(void)sizeof(std::function<void (int, int)>); // expected-error{{'function<void (int, int)>' is deprecated}}
|
||||
(void)sizeof(std::function<void (int, int, int)>); // expected-error{{'function<void (int, int, int)>' is deprecated}}
|
||||
// variable because otherwise we get two warnings for each variable (the
|
||||
// second warning is when the destructor is implicitly called).
|
||||
(void)sizeof(std::function<void ()>); // expected-warning {{'function<void ()>' is deprecated}}
|
||||
(void)sizeof(std::function<void (int)>); // expected-warning {{'function<void (int)>' is deprecated}}
|
||||
(void)sizeof(std::function<void (int, int)>); // expected-warning {{'function<void (int, int)>' is deprecated}}
|
||||
(void)sizeof(std::function<void (int, int, int)>); // expected-warning {{'function<void (int, int, int)>' is deprecated}}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::map<int, int> c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::multimap<int, int> c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::multiset<int> c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::set<int> c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::priority_queue<int> c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::queue<int> c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::stack<int> c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -20,7 +20,6 @@ int main(int, char**) {
|
|||
// expected-error@array:* {{to_array does not accept multidimensional arrays}}
|
||||
// expected-error@array:* {{to_array requires copy constructible elements}}
|
||||
// expected-error@array:* 3 {{cannot initialize}}
|
||||
// expected-error@array:* 0+ {{suggest braces}}
|
||||
std::to_array(source); // expected-note {{requested here}}
|
||||
}
|
||||
|
||||
|
|
|
@ -25,9 +25,9 @@ int main(int, char**)
|
|||
{
|
||||
|
||||
std::array<int, 1> c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
std::array<int, 0> c0;
|
||||
c0.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c0.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::deque<int> c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::forward_list<int> c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::list<int> c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::vector<bool> c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::vector<int> c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::unordered_map<int, int> c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::unordered_multimap<int, int> c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::unordered_multiset<int> c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::unordered_set<int> c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
std::bind1st(test_func(1), 5); // expected-error{{'bind1st<test_func, int>' is deprecated}}
|
||||
std::bind1st(test_func(1), 5); // expected-warning {{'bind1st<test_func, int>' is deprecated}}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
std::bind2nd(test_func(1), 5); // expected-error{{'bind2nd<test_func, int>' is deprecated}}
|
||||
std::bind2nd(test_func(1), 5); // expected-warning {{'bind2nd<test_func, int>' is deprecated}}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
typedef std::binder1st<test_func> B1ST; // expected-error{{'binder1st<test_func>' is deprecated}}
|
||||
typedef std::binder1st<test_func> B1ST; // expected-warning {{'binder1st<test_func>' is deprecated}}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
typedef std::binder2nd<test_func> B2ND; // expected-error{{'binder2nd<test_func>' is deprecated}}
|
||||
typedef std::binder2nd<test_func> B2ND; // expected-warning {{'binder2nd<test_func>' is deprecated}}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
fs::path c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
int c[5];
|
||||
std::empty(c); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
std::empty(c); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::vector<int> c;
|
||||
std::empty(c); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
std::empty(c); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::initializer_list<int> c = { 4 };
|
||||
std::empty(c); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
std::empty(c); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
char buffer[100];
|
||||
::operator new[](4, buffer); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
::operator new[](4, buffer); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
char buffer[100];
|
||||
::operator new(4, buffer); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
::operator new(4, buffer); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
::operator new(4); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
::operator new(4); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
::operator new(4, std::nothrow); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
::operator new(4, std::nothrow); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
int *p = nullptr;
|
||||
std::launder(p); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
std::launder(p); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -16,10 +16,10 @@ int main(int, char**)
|
|||
ui = std::abs(ui); // expected-error {{call to 'abs' is ambiguous}}
|
||||
|
||||
unsigned char uc = -5;
|
||||
uc = std::abs(uc); // expected-error {{taking the absolute value of unsigned type 'unsigned char' has no effect}}
|
||||
uc = std::abs(uc); // expected-warning {{taking the absolute value of unsigned type 'unsigned char' has no effect}}
|
||||
|
||||
unsigned short us = -5;
|
||||
us = std::abs(us); // expected-error {{taking the absolute value of unsigned type 'unsigned short' has no effect}}
|
||||
us = std::abs(us); // expected-warning {{taking the absolute value of unsigned type 'unsigned short' has no effect}}
|
||||
|
||||
unsigned long ul = -5;
|
||||
ul = std::abs(ul); // expected-error {{call to 'abs' is ambiguous}}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::match_results<const char*> c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::string c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::string_view c;
|
||||
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
c.empty(); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -33,8 +33,8 @@ int foo (int x) { return x; }
|
|||
|
||||
int main(int, char**)
|
||||
{
|
||||
std::async( foo, 3); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
std::async(std::launch::async, foo, 3); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
std::async( foo, 3); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
std::async(std::launch::async, foo, 3); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::scoped_allocator_adaptor<A1<int>> a;
|
||||
a.allocate(10); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
a.allocate(10); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::scoped_allocator_adaptor<A1<int>> a;
|
||||
a.allocate(10, (const void*)0); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
a.allocate(10, (const void*)0); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -26,8 +26,8 @@ struct Predicate {
|
|||
};
|
||||
|
||||
int main(int, char**) {
|
||||
std::binary_negate<Predicate> f((Predicate())); // expected-error{{'binary_negate<Predicate>' is deprecated}}
|
||||
std::binary_negate<Predicate> f((Predicate())); // expected-warning {{'binary_negate<Predicate>' is deprecated}}
|
||||
(void)f;
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ struct Predicate {
|
|||
};
|
||||
|
||||
int main(int, char**) {
|
||||
std::not1(Predicate()); // expected-error{{'not1<Predicate>' is deprecated}}
|
||||
std::not1(Predicate()); // expected-warning {{'not1<Predicate>' is deprecated}}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -26,7 +26,7 @@ struct Predicate {
|
|||
};
|
||||
|
||||
int main(int, char**) {
|
||||
std::not2(Predicate()); // expected-error{{'not2<Predicate>' is deprecated}}
|
||||
std::not2(Predicate()); // expected-warning {{'not2<Predicate>' is deprecated}}
|
||||
|
||||
return 0;
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ struct Predicate {
|
|||
};
|
||||
|
||||
int main(int, char**) {
|
||||
std::unary_negate<Predicate> f((Predicate())); // expected-error{{'unary_negate<Predicate>' is deprecated}}
|
||||
std::unary_negate<Predicate> f((Predicate())); // expected-warning {{'unary_negate<Predicate>' is deprecated}}
|
||||
(void)f;
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -46,8 +46,8 @@ struct A
|
|||
int main(int, char**)
|
||||
{
|
||||
A<int> a;
|
||||
std::allocator_traits<A<int> >::allocate(a, 10); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
std::allocator_traits<A<int> >::allocate(a, 10, nullptr); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
std::allocator_traits<A<int> >::allocate(a, 10); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
std::allocator_traits<A<int> >::allocate(a, 10, nullptr); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
int main(int, char**)
|
||||
{
|
||||
std::allocator<int> a;
|
||||
a.allocate(3); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
a.allocate(3); // expected-warning {{ignoring return value of function declared with 'nodiscard' attribute}}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ int main(int, char**)
|
|||
#else
|
||||
// expected-error@+1 {{static_assert failed}}
|
||||
static_assert(!std::is_constant_evaluated(), "");
|
||||
// expected-error@-1 0-1 {{'std::is_constant_evaluated' will always evaluate to 'true' in a manifestly constant-evaluated expression}}
|
||||
// expected-warning@-1 0-1 {{'std::is_constant_evaluated' will always evaluate to 'true' in a manifestly constant-evaluated expression}}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
//===----------------------------------------------------------------------===//
|
||||
|
||||
// <memory>
|
||||
// UNSUPPORTED: c++98, c++03
|
||||
|
||||
// unique_ptr
|
||||
|
||||
|
|
|
@ -238,9 +238,6 @@ class LibcxxTestFormat(object):
|
|||
test_cxx.flags += ['-fsyntax-only']
|
||||
if use_verify:
|
||||
test_cxx.useVerify()
|
||||
test_cxx.useWarnings()
|
||||
if '-Wuser-defined-warnings' in test_cxx.warning_flags:
|
||||
test_cxx.warning_flags += ['-Wno-error=user-defined-warnings']
|
||||
cmd, out, err, rc = test_cxx.compile(source_path, out=os.devnull)
|
||||
check_rc = lambda rc: rc == 0 if use_verify else rc != 0
|
||||
report = libcxx.util.makeReport(cmd, out, err, rc)
|
||||
|
|
Loading…
Reference in New Issue