[libc++] Require the use of clang-verify in .fail.cpp tests that don't fail without it
Some tests do not fail at all when -verify is not supported, unless some
arbitrary warning flag is added to make them fail. We currently used
-Werror=unused-result to make them fail, but doing so makes the test
suite a lot more inscrutable. It seems better to just disable those
tests when -verify is not supported.
Differential Revision: https://reviews.llvm.org/D76256
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 61c4e75..71b18c9 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
@@ -15,6 +15,7 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
+// REQUIRES: verify-support
#include <map>
@@ -25,5 +26,5 @@
std::map<int, int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
+ 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 bc305b9..4aeba89 100644
--- a/libcxx/test/std/containers/associative/multimap/empty.fail.cpp
+++ b/libcxx/test/std/containers/associative/multimap/empty.fail.cpp
@@ -15,6 +15,7 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
+// REQUIRES: verify-support
#include <map>
@@ -25,5 +26,5 @@
std::multimap<int, int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
+ 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 4467b48..742ea3f 100644
--- a/libcxx/test/std/containers/associative/multiset/empty.fail.cpp
+++ b/libcxx/test/std/containers/associative/multiset/empty.fail.cpp
@@ -15,6 +15,7 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
+// REQUIRES: verify-support
#include <set>
@@ -25,5 +26,5 @@
std::multiset<int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
+ 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 fc5856f..e181fd4 100644
--- a/libcxx/test/std/containers/associative/set/empty.fail.cpp
+++ b/libcxx/test/std/containers/associative/set/empty.fail.cpp
@@ -15,6 +15,7 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
+// REQUIRES: verify-support
#include <set>
@@ -25,5 +26,5 @@
std::set<int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
+ 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 698553d..b39038d 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
@@ -15,6 +15,7 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
+// REQUIRES: verify-support
#include <queue>
@@ -25,5 +26,5 @@
std::priority_queue<int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
+ 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 454bf32..f33fe87 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
@@ -15,6 +15,7 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
+// REQUIRES: verify-support
#include <queue>
@@ -25,5 +26,5 @@
std::queue<int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
+ 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 54cd986..2100949 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
@@ -15,6 +15,7 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
+// REQUIRES: verify-support
#include <stack>
@@ -25,5 +26,5 @@
std::stack<int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
+ return 0;
}
diff --git a/libcxx/test/std/containers/sequences/array/empty.fail.cpp b/libcxx/test/std/containers/sequences/array/empty.fail.cpp
index 3bbb3c8..cfb83c5 100644
--- a/libcxx/test/std/containers/sequences/array/empty.fail.cpp
+++ b/libcxx/test/std/containers/sequences/array/empty.fail.cpp
@@ -15,6 +15,7 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
+// REQUIRES: verify-support
#include <array>
@@ -28,5 +29,5 @@
std::array<int, 0> c0;
c0.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
+ 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 79e4b30..560a279 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
@@ -15,6 +15,7 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
+// REQUIRES: verify-support
#include <deque>
@@ -25,5 +26,5 @@
std::deque<int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
+ 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 2ca3e02..24ee897 100644
--- a/libcxx/test/std/containers/sequences/forwardlist/empty.fail.cpp
+++ b/libcxx/test/std/containers/sequences/forwardlist/empty.fail.cpp
@@ -15,6 +15,7 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
+// REQUIRES: verify-support
#include <forward_list>
@@ -25,5 +26,5 @@
std::forward_list<int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
+ 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 0cbaa46..d396db6 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
@@ -15,6 +15,7 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
+// REQUIRES: verify-support
#include <list>
@@ -25,5 +26,5 @@
std::list<int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
+ 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 0a84eb7..9db4b4a 100644
--- a/libcxx/test/std/containers/sequences/vector.bool/empty.fail.cpp
+++ b/libcxx/test/std/containers/sequences/vector.bool/empty.fail.cpp
@@ -15,6 +15,7 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
+// REQUIRES: verify-support
#include <vector>
@@ -25,5 +26,5 @@
std::vector<bool> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
+ 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 0f7dc6c..ae4878c 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
@@ -15,6 +15,7 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
+// REQUIRES: verify-support
#include <vector>
@@ -25,5 +26,5 @@
std::vector<int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
+ 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 283d6fa..640832b 100644
--- a/libcxx/test/std/containers/unord/unord.map/empty.fail.cpp
+++ b/libcxx/test/std/containers/unord/unord.map/empty.fail.cpp
@@ -15,6 +15,7 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
+// REQUIRES: verify-support
#include <unordered_map>
@@ -25,5 +26,5 @@
std::unordered_map<int, int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
+ 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 4eb7bfc..72b4fd9 100644
--- a/libcxx/test/std/containers/unord/unord.multimap/empty.fail.cpp
+++ b/libcxx/test/std/containers/unord/unord.multimap/empty.fail.cpp
@@ -15,6 +15,7 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
+// REQUIRES: verify-support
#include <unordered_map>
@@ -25,5 +26,5 @@
std::unordered_multimap<int, int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
+ 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 449b211..1a19d33 100644
--- a/libcxx/test/std/containers/unord/unord.multiset/empty.fail.cpp
+++ b/libcxx/test/std/containers/unord/unord.multiset/empty.fail.cpp
@@ -15,6 +15,7 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
+// REQUIRES: verify-support
#include <unordered_set>
@@ -25,5 +26,5 @@
std::unordered_multiset<int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
+ 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 11273f4..4272e7a 100644
--- a/libcxx/test/std/containers/unord/unord.set/empty.fail.cpp
+++ b/libcxx/test/std/containers/unord/unord.set/empty.fail.cpp
@@ -15,6 +15,7 @@
// UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
// UNSUPPORTED: clang-3.3, clang-3.4, clang-3.5, clang-3.6, clang-3.7, clang-3.8
+// REQUIRES: verify-support
#include <unordered_set>
@@ -25,5 +26,5 @@
std::unordered_set<int> c;
c.empty(); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
- return 0;
+ return 0;
}