[libcxx-commits] [libcxx] aec82f9 - [libc++] Require the use of clang-verify in .fail.cpp tests that don't fail without it

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 25 13:49:47 PDT 2020


Author: Louis Dionne
Date: 2020-03-25T16:48:09-04:00
New Revision: aec82f9256a559f5884420920c1956e60a1474d9

URL: https://github.com/llvm/llvm-project/commit/aec82f9256a559f5884420920c1956e60a1474d9
DIFF: https://github.com/llvm/llvm-project/commit/aec82f9256a559f5884420920c1956e60a1474d9.diff

LOG: [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

Added: 
    

Modified: 
    libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.fail.cpp
    libcxx/test/libcxx/diagnostics/enable_nodiscard.fail.cpp
    libcxx/test/libcxx/diagnostics/enable_nodiscard_disable_after_cxx17.fail.cpp
    libcxx/test/libcxx/diagnostics/enable_nodiscard_disable_nodiscard_ext.fail.cpp
    libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.fail.cpp
    libcxx/test/libcxx/diagnostics/nodiscard_extensions.fail.cpp
    libcxx/test/libcxx/thread/thread.lock/thread.lock.guard/nodiscard.fail.cpp
    libcxx/test/std/containers/associative/map/map.access/empty.fail.cpp
    libcxx/test/std/containers/associative/multimap/empty.fail.cpp
    libcxx/test/std/containers/associative/multiset/empty.fail.cpp
    libcxx/test/std/containers/associative/set/empty.fail.cpp
    libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.members/empty.fail.cpp
    libcxx/test/std/containers/container.adaptors/queue/queue.defn/empty.fail.cpp
    libcxx/test/std/containers/container.adaptors/stack/stack.defn/empty.fail.cpp
    libcxx/test/std/containers/sequences/array/empty.fail.cpp
    libcxx/test/std/containers/sequences/deque/deque.capacity/empty.fail.cpp
    libcxx/test/std/containers/sequences/forwardlist/empty.fail.cpp
    libcxx/test/std/containers/sequences/list/list.capacity/empty.fail.cpp
    libcxx/test/std/containers/sequences/vector.bool/empty.fail.cpp
    libcxx/test/std/containers/sequences/vector/vector.capacity/empty.fail.cpp
    libcxx/test/std/containers/unord/unord.map/empty.fail.cpp
    libcxx/test/std/containers/unord/unord.multimap/empty.fail.cpp
    libcxx/test/std/containers/unord/unord.multiset/empty.fail.cpp
    libcxx/test/std/containers/unord/unord.set/empty.fail.cpp
    libcxx/test/std/input.output/filesystems/class.path/path.member/path.decompose/empty.fail.cpp
    libcxx/test/std/iterators/iterator.container/empty.array.fail.cpp
    libcxx/test/std/iterators/iterator.container/empty.container.fail.cpp
    libcxx/test/std/iterators/iterator.container/empty.initializer_list.fail.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_array_ptr.fail.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.placement/new_ptr.fail.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size.fail.cpp
    libcxx/test/std/language.support/support.dynamic/new.delete/new.delete.single/new_size_nothrow.fail.cpp
    libcxx/test/std/language.support/support.dynamic/ptr.launder/launder.nodiscard.fail.cpp
    libcxx/test/std/re/re.results/re.results.size/empty.fail.cpp
    libcxx/test/std/strings/basic.string/string.capacity/empty.fail.cpp
    libcxx/test/std/strings/string.view/string.view.capacity/empty.fail.cpp
    libcxx/test/std/thread/futures/futures.async/async.fail.cpp
    libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size.fail.cpp
    libcxx/test/std/utilities/allocator.adaptor/allocator.adaptor.members/allocate_size_hint.fail.cpp
    libcxx/test/std/utilities/memory/allocator.traits/allocator.traits.members/allocate.fail.cpp
    libcxx/test/std/utilities/memory/default.allocator/allocator.members/allocate.fail.cpp
    libcxx/utils/libcxx/test/format.py

Removed: 
    


################################################################################
diff  --git a/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.fail.cpp b/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.fail.cpp
index db06f99f7f42..fcce979b99e9 100644
--- a/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.fail.cpp
+++ b/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.fail.cpp
@@ -8,6 +8,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
 
 // <memory>
 
@@ -33,5 +34,5 @@ int main(int, char**)
     std::allocator<int> a;
     a.allocate(3, nullptr); // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
 
-  return 0;
+    return 0;
 }

diff  --git a/libcxx/test/libcxx/diagnostics/enable_nodiscard.fail.cpp b/libcxx/test/libcxx/diagnostics/enable_nodiscard.fail.cpp
index b42e4c4e962f..ca54ecac54b7 100644
--- a/libcxx/test/libcxx/diagnostics/enable_nodiscard.fail.cpp
+++ b/libcxx/test/libcxx/diagnostics/enable_nodiscard.fail.cpp
@@ -16,6 +16,8 @@
 // GCC 7 is the first version to introduce [[nodiscard]]
 // UNSUPPORTED: gcc-5, gcc-6
 
+// REQUIRES: verify-support
+
 // MODULES_DEFINES: _LIBCPP_ENABLE_NODISCARD
 #define _LIBCPP_ENABLE_NODISCARD
 

diff  --git a/libcxx/test/libcxx/diagnostics/enable_nodiscard_disable_after_cxx17.fail.cpp b/libcxx/test/libcxx/diagnostics/enable_nodiscard_disable_after_cxx17.fail.cpp
index 72fbc01198ef..0406418f7053 100644
--- a/libcxx/test/libcxx/diagnostics/enable_nodiscard_disable_after_cxx17.fail.cpp
+++ b/libcxx/test/libcxx/diagnostics/enable_nodiscard_disable_after_cxx17.fail.cpp
@@ -8,6 +8,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03
+// REQUIRES: verify-support
 
 // GCC 7 is the first version to introduce [[nodiscard]]
 // UNSUPPORTED: gcc-5, gcc-6

diff  --git a/libcxx/test/libcxx/diagnostics/enable_nodiscard_disable_nodiscard_ext.fail.cpp b/libcxx/test/libcxx/diagnostics/enable_nodiscard_disable_nodiscard_ext.fail.cpp
index 65e5e1521331..3caf3cf7947d 100644
--- a/libcxx/test/libcxx/diagnostics/enable_nodiscard_disable_nodiscard_ext.fail.cpp
+++ b/libcxx/test/libcxx/diagnostics/enable_nodiscard_disable_nodiscard_ext.fail.cpp
@@ -8,6 +8,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03
+// REQUIRES: verify-support
 
 // GCC 7 is the first version to introduce [[nodiscard]]
 // UNSUPPORTED: gcc-5, gcc-6

diff  --git a/libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.fail.cpp b/libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.fail.cpp
index 8cfbc3117853..fe1de0476e67 100644
--- a/libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.fail.cpp
+++ b/libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.fail.cpp
@@ -11,6 +11,7 @@
 //	#define _LIBCPP_NODISCARD_AFTER_CXX17 [[nodiscard]]
 
 // UNSUPPORTED: c++98, c++03, c++11, c++14, c++17
+// REQUIRES: verify-support
 
 #include <__config>
 
@@ -20,5 +21,5 @@ int main(int, char**)
 {
 	foo();	// expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
 
-  return 0;
+    return 0;
 }

diff  --git a/libcxx/test/libcxx/diagnostics/nodiscard_extensions.fail.cpp b/libcxx/test/libcxx/diagnostics/nodiscard_extensions.fail.cpp
index dd02a3dd25db..705b21c5af97 100644
--- a/libcxx/test/libcxx/diagnostics/nodiscard_extensions.fail.cpp
+++ b/libcxx/test/libcxx/diagnostics/nodiscard_extensions.fail.cpp
@@ -8,9 +8,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: c++98, c++03
-
-// GCC versions prior to 7.0 don't provide the required [[nodiscard]] attribute.
-// UNSUPPORTED: gcc-5, gcc-6
+// REQUIRES: verify-support
 
 // AppleClang9 doesn't yet support C++17's implicitly synthesized deduction
 // guides from existing ctors, needed by default_searcher() below.

diff  --git a/libcxx/test/libcxx/thread/thread.lock/thread.lock.guard/nodiscard.fail.cpp b/libcxx/test/libcxx/thread/thread.lock/thread.lock.guard/nodiscard.fail.cpp
index 802892a5eb39..9fc4eff282b8 100644
--- a/libcxx/test/libcxx/thread/thread.lock/thread.lock.guard/nodiscard.fail.cpp
+++ b/libcxx/test/libcxx/thread/thread.lock/thread.lock.guard/nodiscard.fail.cpp
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 // UNSUPPORTED: libcpp-has-no-threads
+// REQUIRES: verify-support
 
 // [[nodiscard]] on constructors isn't supported by all compilers
 // UNSUPPORTED: clang-6, clang-7, clang-8, clang-9

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 61c4e757b0c3..71b18c9dad93 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 @@ int main(int, char**)
     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 bc305b9cc8db..4aeba89fb2e2 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 @@ int main(int, char**)
     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 4467b487089b..742ea3f248bb 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 @@ int main(int, char**)
     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 fc5856fbdbf4..e181fd43f101 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 @@ int main(int, char**)
     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 698553d33e10..b39038df18c3 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 @@ int main(int, char**)
     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 454bf32bede8..f33fe8709e9f 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 @@ int main(int, char**)
     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 54cd986295a6..210094948d1a 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 @@ int main(int, char**)
     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 3bbb3c8e1c04..cfb83c59b423 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 @@ int main(int, char**)
     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 79e4b30b2b27..560a27927ea9 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 @@ int main(int, char**)
     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 2ca3e024e661..24ee897df207 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 @@ int main(int, char**)
     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 0cbaa464d4a1..d396db60df41 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 @@ int main(int, char**)
     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 0a84eb79d125..9db4b4ad893b 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 @@ int main(int, char**)
     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 0f7dc6c64cc0..ae4878cd7b6c 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 @@ int main(int, char**)
     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 283d6fa3e243..640832b85bbd 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 @@ int main(int, char**)
     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 4eb7bfc9c36c..72b4fd917cca 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 @@ int main(int, char**)
     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 449b2116a547..1a19d33c74ed 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 @@ int main(int, char**)
     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 11273f44fceb..4272e7abda58 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 @@ int main(int, char**)
     std::unordered_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/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 dbadf468805d..5d1452232465 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
@@ -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 "filesystem_include.h"
 
@@ -25,5 +26,5 @@ int main(int, char**)
     fs::path c;
     c.empty();  // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
 
-  return 0;
+    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 08014776c9df..3f3db027602f 100644
--- a/libcxx/test/std/iterators/iterator.container/empty.array.fail.cpp
+++ b/libcxx/test/std/iterators/iterator.container/empty.array.fail.cpp
@@ -14,6 +14,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>
 #include <iterator>
@@ -25,5 +26,5 @@ int main(int, char**)
     int c[5];
     std::empty(c);  // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
 
-  return 0;
+    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 153ea13b643e..8ccb54b4e12b 100644
--- a/libcxx/test/std/iterators/iterator.container/empty.container.fail.cpp
+++ b/libcxx/test/std/iterators/iterator.container/empty.container.fail.cpp
@@ -14,6 +14,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>
 #include <iterator>
@@ -25,5 +26,5 @@ int main(int, char**)
     std::vector<int> c;
     std::empty(c);  // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
 
-  return 0;
+    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 5dafb5119fe9..d6a4bb72b0b3 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
@@ -14,6 +14,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 <initializer_list>
 #include <iterator>
@@ -25,5 +26,5 @@ int main(int, char**)
     std::initializer_list<int> c = { 4 };
     std::empty(c);  // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
 
-  return 0;
+    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 4cba717dba80..78d62173dc07 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
@@ -13,6 +13,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 <new>
 
@@ -23,5 +24,5 @@ int main(int, char**)
     char buffer[100];
     ::operator new[](4, buffer);  // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
 
-  return 0;
+    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 05a9b244c1e4..10d52a1ae95b 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
@@ -13,6 +13,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 <new>
 
@@ -23,5 +24,5 @@ int main(int, char**)
     char buffer[100];
     ::operator new(4, buffer);  // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
 
-  return 0;
+    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 4769933d399a..ebb7fc62448c 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
@@ -13,6 +13,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 <new>
 
@@ -22,5 +23,5 @@ int main(int, char**)
 {
     ::operator new(4);  // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
 
-  return 0;
+    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 a0bfa8b7f921..8f465033439f 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
@@ -13,6 +13,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 <new>
 
@@ -22,5 +23,5 @@ int main(int, char**)
 {
     ::operator new(4, std::nothrow);  // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
 
-  return 0;
+    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 e7252395d353..37a1a1d61725 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
@@ -13,6 +13,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 <new>
 #include <cassert>
@@ -24,5 +25,5 @@ int main(int, char**)
     int *p = nullptr;
     std::launder(p);  // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
 
-  return 0;
+    return 0;
 }

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 e17c77424656..1316c47c3d02 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
@@ -14,6 +14,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 <regex>
 
@@ -24,5 +25,5 @@ int main(int, char**)
     std::match_results<const char*> c;
     c.empty();  // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
 
-  return 0;
+    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 1bfa388b7b9c..20fa674893c2 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
@@ -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 <string>
 
@@ -25,5 +26,5 @@ int main(int, char**)
     std::string c;
     c.empty();  // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
 
-  return 0;
+    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 1dd1dcf7cb5b..292868238f8a 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
@@ -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 <string_view>
 
@@ -25,5 +26,5 @@ int main(int, char**)
     std::string_view c;
     c.empty();  // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
 
-  return 0;
+    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 3e7fb80e0e1f..4629bd393caa 100644
--- a/libcxx/test/std/thread/futures/futures.async/async.fail.cpp
+++ b/libcxx/test/std/thread/futures/futures.async/async.fail.cpp
@@ -9,6 +9,7 @@
 // UNSUPPORTED: libcpp-has-no-threads
 // 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
 
 // <future>
 
@@ -35,5 +36,5 @@ 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}}
 
-  return 0;
+    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 6d644db85e8c..91815b49b38d 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
@@ -8,6 +8,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
 
 // <memory>
 
@@ -26,5 +27,5 @@ 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}}
 
-  return 0;
+    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 7cf3d4109096..5af4e4f19a5f 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
@@ -8,6 +8,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
 
 // <memory>
 
@@ -26,5 +27,5 @@ 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}}
 
-  return 0;
+    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 47cfbb0494b5..4bf56e274f0b 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
@@ -17,6 +17,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 <memory>
 #include <cstdint>
@@ -48,5 +49,5 @@ int main(int, char**)
     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}}
 
-  return 0;
+    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 4cbd29029331..88eaaa5c67d3 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
@@ -8,6 +8,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
 
 // <memory>
 
@@ -24,5 +25,5 @@ int main(int, char**)
     std::allocator<int> a;
     a.allocate(3);          // expected-error {{ignoring return value of function declared with 'nodiscard' attribute}}
 
-  return 0;
+    return 0;
 }

diff  --git a/libcxx/utils/libcxx/test/format.py b/libcxx/utils/libcxx/test/format.py
index 7b635a12b3d0..754550756ca4 100644
--- a/libcxx/utils/libcxx/test/format.py
+++ b/libcxx/utils/libcxx/test/format.py
@@ -241,18 +241,6 @@ def _evaluate_fail_test(self, test, test_cxx, parsers):
             test_cxx.useWarnings()
             if '-Wuser-defined-warnings' in test_cxx.warning_flags:
                 test_cxx.warning_flags += ['-Wno-error=user-defined-warnings']
-        else:
-            # We still need to enable certain warnings on .fail.cpp test when
-            # -verify isn't enabled. Such as -Werror=unused-result. However,
-            # we don't want it enabled too liberally, which might incorrectly
-            # allow unrelated failure tests to 'pass'.
-            #
-            # Therefore, we check if the test was expected to fail because of
-            # nodiscard before enabling it
-            test_str_list = [b'ignoring return value', b'nodiscard',
-                             b'NODISCARD']
-            if any(test_str in contents for test_str in test_str_list):
-                test_cxx.flags += ['-Werror=unused-result']
         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)


        


More information about the libcxx-commits mailing list