[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
diff --git a/libcxx/test/std/containers/associative/map/map.access/empty.fail.cpp b/libcxx/test/std/containers/associative/map/map.access/empty.fail.cpp
index 71b18c9..0043097 100644
--- a/libcxx/test/std/containers/associative/map/map.access/empty.fail.cpp
+++ b/libcxx/test/std/containers/associative/map/map.access/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/containers/associative/multimap/empty.fail.cpp b/libcxx/test/std/containers/associative/multimap/empty.fail.cpp
index 4aeba89..2492be5 100644
--- a/libcxx/test/std/containers/associative/multimap/empty.fail.cpp
+++ b/libcxx/test/std/containers/associative/multimap/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/containers/associative/multiset/empty.fail.cpp b/libcxx/test/std/containers/associative/multiset/empty.fail.cpp
index 742ea3f..abc67ed 100644
--- a/libcxx/test/std/containers/associative/multiset/empty.fail.cpp
+++ b/libcxx/test/std/containers/associative/multiset/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/containers/associative/set/empty.fail.cpp b/libcxx/test/std/containers/associative/set/empty.fail.cpp
index e181fd4..ba6aadc 100644
--- a/libcxx/test/std/containers/associative/set/empty.fail.cpp
+++ b/libcxx/test/std/containers/associative/set/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.members/empty.fail.cpp b/libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.members/empty.fail.cpp
index b39038d..fa3476a 100644
--- a/libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.members/empty.fail.cpp
+++ b/libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.members/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/containers/container.adaptors/queue/queue.defn/empty.fail.cpp b/libcxx/test/std/containers/container.adaptors/queue/queue.defn/empty.fail.cpp
index f33fe87..6cd0a5e 100644
--- a/libcxx/test/std/containers/container.adaptors/queue/queue.defn/empty.fail.cpp
+++ b/libcxx/test/std/containers/container.adaptors/queue/queue.defn/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/containers/container.adaptors/stack/stack.defn/empty.fail.cpp b/libcxx/test/std/containers/container.adaptors/stack/stack.defn/empty.fail.cpp
index 2100949..fb10758 100644
--- a/libcxx/test/std/containers/container.adaptors/stack/stack.defn/empty.fail.cpp
+++ b/libcxx/test/std/containers/container.adaptors/stack/stack.defn/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/containers/sequences/array/array.creation/to_array.fail.cpp b/libcxx/test/std/containers/sequences/array/array.creation/to_array.fail.cpp
index 9e194cf..49ad6a6 100644
--- a/libcxx/test/std/containers/sequences/array/array.creation/to_array.fail.cpp
+++ b/libcxx/test/std/containers/sequences/array/array.creation/to_array.fail.cpp
@@ -20,7 +20,6 @@
// 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}}
}
diff --git a/libcxx/test/std/containers/sequences/array/empty.fail.cpp b/libcxx/test/std/containers/sequences/array/empty.fail.cpp
index cfb83c5..4afd901 100644
--- a/libcxx/test/std/containers/sequences/array/empty.fail.cpp
+++ b/libcxx/test/std/containers/sequences/array/empty.fail.cpp
@@ -25,9 +25,9 @@
{
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;
}
diff --git a/libcxx/test/std/containers/sequences/deque/deque.capacity/empty.fail.cpp b/libcxx/test/std/containers/sequences/deque/deque.capacity/empty.fail.cpp
index 560a279..1f38354 100644
--- a/libcxx/test/std/containers/sequences/deque/deque.capacity/empty.fail.cpp
+++ b/libcxx/test/std/containers/sequences/deque/deque.capacity/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/containers/sequences/forwardlist/empty.fail.cpp b/libcxx/test/std/containers/sequences/forwardlist/empty.fail.cpp
index 24ee897..da74faa 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/empty.fail.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/containers/sequences/list/list.capacity/empty.fail.cpp b/libcxx/test/std/containers/sequences/list/list.capacity/empty.fail.cpp
index d396db6..d8b6216 100644
--- a/libcxx/test/std/containers/sequences/list/list.capacity/empty.fail.cpp
+++ b/libcxx/test/std/containers/sequences/list/list.capacity/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/containers/sequences/vector.bool/empty.fail.cpp b/libcxx/test/std/containers/sequences/vector.bool/empty.fail.cpp
index 9db4b4a..02d737b 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/empty.fail.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/containers/sequences/vector/vector.capacity/empty.fail.cpp b/libcxx/test/std/containers/sequences/vector/vector.capacity/empty.fail.cpp
index ae4878c..82195b2 100644
--- a/libcxx/test/std/containers/sequences/vector/vector.capacity/empty.fail.cpp
+++ b/libcxx/test/std/containers/sequences/vector/vector.capacity/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/containers/unord/unord.map/empty.fail.cpp b/libcxx/test/std/containers/unord/unord.map/empty.fail.cpp
index 640832b..1f39c7a 100644
--- a/libcxx/test/std/containers/unord/unord.map/empty.fail.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/containers/unord/unord.multimap/empty.fail.cpp b/libcxx/test/std/containers/unord/unord.multimap/empty.fail.cpp
index 72b4fd9..735ad19 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/empty.fail.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/containers/unord/unord.multiset/empty.fail.cpp b/libcxx/test/std/containers/unord/unord.multiset/empty.fail.cpp
index 1a19d33..d0eba65 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/empty.fail.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/containers/unord/unord.set/empty.fail.cpp b/libcxx/test/std/containers/unord/unord.set/empty.fail.cpp
index 4272e7a..2eeeafb 100644
--- a/libcxx/test/std/containers/unord/unord.set/empty.fail.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.fail.cpp b/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.fail.cpp
index 65cde49..9efea4b 100644
--- a/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.fail.cpp
+++ b/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.fail.cpp b/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.fail.cpp
index 7a98e79..a1c8081 100644
--- a/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.fail.cpp
+++ b/libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.fail.cpp b/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.fail.cpp
index b66ca3b..6a5bc32 100644
--- a/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.fail.cpp
+++ b/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.fail.cpp b/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.fail.cpp
index 8afc9ee..6ec5b6e 100644
--- a/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.fail.cpp
+++ b/libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.fail.cpp b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.fail.cpp
index 5d14522..1371fa1 100644
--- a/libcxx/test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.fail.cpp
+++ b/libcxx/test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/iterators/iterator.container/empty.array.fail.cpp b/libcxx/test/std/iterators/iterator.container/empty.array.fail.cpp
index 3f3db02..98871f1 100644
--- a/libcxx/test/std/iterators/iterator.container/empty.array.fail.cpp
+++ b/libcxx/test/std/iterators/iterator.container/empty.array.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/iterators/iterator.container/empty.container.fail.cpp b/libcxx/test/std/iterators/iterator.container/empty.container.fail.cpp
index 8ccb54b..3f1179f 100644
--- a/libcxx/test/std/iterators/iterator.container/empty.container.fail.cpp
+++ b/libcxx/test/std/iterators/iterator.container/empty.container.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/iterators/iterator.container/empty.initializer_list.fail.cpp b/libcxx/test/std/iterators/iterator.container/empty.initializer_list.fail.cpp
index d6a4bb7..cd8ccb8 100644
--- a/libcxx/test/std/iterators/iterator.container/empty.initializer_list.fail.cpp
+++ b/libcxx/test/std/iterators/iterator.container/empty.initializer_list.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.fail.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.fail.cpp
index 78d6217..2972e85 100644
--- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.fail.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.fail.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.fail.cpp
index 10d52a1..45853b5 100644
--- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.fail.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size.fail.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size.fail.cpp
index ebb7fc6..3c7ce2e 100644
--- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size.fail.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_nothrow.fail.cpp b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_nothrow.fail.cpp
index 8f46503..f620c4e 100644
--- a/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_nothrow.fail.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_nothrow.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.nodiscard.fail.cpp b/libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.nodiscard.fail.cpp
index 37a1a1d..bec35f5 100644
--- a/libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.nodiscard.fail.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.nodiscard.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/numerics/c.math/abs.fail.cpp b/libcxx/test/std/numerics/c.math/abs.fail.cpp
index 16f112c..d58cf0d 100644
--- a/libcxx/test/std/numerics/c.math/abs.fail.cpp
+++ b/libcxx/test/std/numerics/c.math/abs.fail.cpp
@@ -16,10 +16,10 @@
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}}
diff --git a/libcxx/test/std/re/re.results/re.results.size/empty.fail.cpp b/libcxx/test/std/re/re.results/re.results.size/empty.fail.cpp
index 1316c47..f496e0f 100644
--- a/libcxx/test/std/re/re.results/re.results.size/empty.fail.cpp
+++ b/libcxx/test/std/re/re.results/re.results.size/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/strings/basic.string/string.capacity/empty.fail.cpp b/libcxx/test/std/strings/basic.string/string.capacity/empty.fail.cpp
index 20fa674..ff1abd5 100644
--- a/libcxx/test/std/strings/basic.string/string.capacity/empty.fail.cpp
+++ b/libcxx/test/std/strings/basic.string/string.capacity/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/strings/string.view/string.view.capacity/empty.fail.cpp b/libcxx/test/std/strings/string.view/string.view.capacity/empty.fail.cpp
index 2928682..cbb7b8f 100644
--- a/libcxx/test/std/strings/string.view/string.view.capacity/empty.fail.cpp
+++ b/libcxx/test/std/strings/string.view/string.view.capacity/empty.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/thread/futures/futures.async/async.fail.cpp b/libcxx/test/std/thread/futures/futures.async/async.fail.cpp
index 4629bd3..19c17d2 100644
--- a/libcxx/test/std/thread/futures/futures.async/async.fail.cpp
+++ b/libcxx/test/std/thread/futures/futures.async/async.fail.cpp
@@ -33,8 +33,8 @@
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;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.fail.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.fail.cpp
index 91815b4..59fb1b5 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.fail.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.fail.cpp b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.fail.cpp
index 5af4e4f..aa46da8 100644
--- a/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.fail.cpp
+++ b/libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.fail.cpp b/libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.fail.cpp
index 1270482..e6aa237 100644
--- a/libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.fail.cpp
+++ b/libcxx/test/std/utilities/function.objects/negators/binary_negate.depr_in_cxx17.fail.cpp
@@ -26,8 +26,8 @@
};
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;
}
diff --git a/libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.fail.cpp b/libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.fail.cpp
index e45605c..49be77d 100644
--- a/libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.fail.cpp
+++ b/libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.fail.cpp
@@ -25,7 +25,7 @@
};
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;
}
diff --git a/libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.fail.cpp b/libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.fail.cpp
index e73ee89..6737bad 100644
--- a/libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.fail.cpp
+++ b/libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.fail.cpp
@@ -26,7 +26,7 @@
};
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;
}
diff --git a/libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.fail.cpp b/libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.fail.cpp
index 1dc9055..6530c55 100644
--- a/libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.fail.cpp
+++ b/libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.fail.cpp
@@ -25,7 +25,7 @@
};
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;
diff --git a/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.fail.cpp b/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.fail.cpp
index 4bf56e2..0545b6d 100644
--- a/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.fail.cpp
+++ b/libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.fail.cpp
@@ -46,8 +46,8 @@
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;
}
diff --git a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.fail.cpp b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.fail.cpp
index 88eaaa5..b24104d 100644
--- a/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.fail.cpp
+++ b/libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.fail.cpp
@@ -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;
}
diff --git a/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.fail.cpp b/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.fail.cpp
index 2d2e071..a6ce114 100644
--- a/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.fail.cpp
+++ b/libcxx/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.fail.cpp
@@ -24,7 +24,7 @@
#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;
}
diff --git a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset.runtime.fail.cpp b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset.runtime.fail.cpp
index 7e3085a..afb19b3 100644
--- a/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset.runtime.fail.cpp
+++ b/libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset.runtime.fail.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// <memory>
+// UNSUPPORTED: c++98, c++03
// unique_ptr