[libcxx-commits] [libcxx] a5fa5f7 - [libc++] Do not force the use of -Werror in verify tests

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 26 04:54:53 PDT 2020


Author: Louis Dionne
Date: 2020-03-26T07:54:45-04:00
New Revision: a5fa5f7cb86c8c271e628f49454cf6d27ba7b11f

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

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

Added: 
    

Modified: 
    libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.fail.cpp
    libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.fail.cpp
    libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/address.depr_in_cxx17.fail.cpp
    libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.cxx2a.fail.cpp
    libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.depr_in_cxx17.fail.cpp
    libcxx/test/libcxx/depr/depr.default.allocator/allocator_types.depr_in_cxx17.fail.cpp
    libcxx/test/libcxx/depr/depr.default.allocator/allocator_void.depr_in_cxx17.fail.cpp
    libcxx/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.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/experimental/filesystem/deprecated.fail.cpp
    libcxx/test/libcxx/thread/thread.lock/thread.lock.guard/nodiscard.fail.cpp
    libcxx/test/libcxx/utilities/function.objects/func.wrap/depr_in_cxx03.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/array.creation/to_array.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/depr/depr.lib.binders/depr.lib.bind.1st/bind1st.depr_in_cxx11.fail.cpp
    libcxx/test/std/depr/depr.lib.binders/depr.lib.bind.2nd/bind2nd.depr_in_cxx11.fail.cpp
    libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.1st/binder1st.depr_in_cxx11.fail.cpp
    libcxx/test/std/depr/depr.lib.binders/depr.lib.binder.2nd/binder2nd.depr_in_cxx11.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/numerics/c.math/abs.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/function.objects/negators/binary_negate.depr_in_cxx17.fail.cpp
    libcxx/test/std/utilities/function.objects/negators/not1.depr_in_cxx17.fail.cpp
    libcxx/test/std/utilities/function.objects/negators/not2.depr_in_cxx17.fail.cpp
    libcxx/test/std/utilities/function.objects/negators/unary_negate.depr_in_cxx17.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/test/std/utilities/meta/meta.const.eval/is_constant_evaluated.fail.cpp
    libcxx/test/std/utilities/smartptr/unique.ptr/unique.ptr.class/unique.ptr.modifiers/reset.runtime.fail.cpp
    libcxx/utils/libcxx/test/format.py

Removed: 
    


################################################################################
diff  --git a/libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.fail.cpp b/libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.fail.cpp
index 10f6498716b2..b67f9a8b75fa 100644
--- a/libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.fail.cpp
+++ b/libcxx/test/libcxx/algorithms/alg.modifying.operations/alg.random.shuffle/random_shuffle.depr_in_cxx14.fail.cpp
@@ -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;
 }

diff  --git a/libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.fail.cpp b/libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.fail.cpp
index b00390f88073..0b7d908e2bdd 100644
--- a/libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.fail.cpp
+++ b/libcxx/test/libcxx/depr/depr.auto.ptr/auto.ptr/auto_ptr.depr_in_cxx11.fail.cpp
@@ -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;
 }

diff  --git a/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/address.depr_in_cxx17.fail.cpp b/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/address.depr_in_cxx17.fail.cpp
index f659f43b230e..03cd3b7bd67e 100644
--- a/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/address.depr_in_cxx17.fail.cpp
+++ b/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/address.depr_in_cxx17.fail.cpp
@@ -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;

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 fcce979b99e9..9c2e4b1cecd7 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
@@ -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;
 }

diff  --git a/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.depr_in_cxx17.fail.cpp b/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.depr_in_cxx17.fail.cpp
index 8a2090a9e8ab..03b1791d1601 100644
--- a/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.depr_in_cxx17.fail.cpp
+++ b/libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/allocate.depr_in_cxx17.fail.cpp
@@ -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;
 }

diff  --git a/libcxx/test/libcxx/depr/depr.default.allocator/allocator_types.depr_in_cxx17.fail.cpp b/libcxx/test/libcxx/depr/depr.default.allocator/allocator_types.depr_in_cxx17.fail.cpp
index 907df94d779b..c1a6333c0b07 100644
--- a/libcxx/test/libcxx/depr/depr.default.allocator/allocator_types.depr_in_cxx17.fail.cpp
+++ b/libcxx/test/libcxx/depr/depr.default.allocator/allocator_types.depr_in_cxx17.fail.cpp
@@ -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>::
diff erence_type ADT;    // expected-error{{'
diff erence_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>::
diff erence_type ADT;    // expected-warning {{'
diff erence_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;
 }

diff  --git a/libcxx/test/libcxx/depr/depr.default.allocator/allocator_void.depr_in_cxx17.fail.cpp b/libcxx/test/libcxx/depr/depr.default.allocator/allocator_void.depr_in_cxx17.fail.cpp
index 64b8ecda8d61..82d1777a5d2b 100644
--- a/libcxx/test/libcxx/depr/depr.default.allocator/allocator_void.depr_in_cxx17.fail.cpp
+++ b/libcxx/test/libcxx/depr/depr.default.allocator/allocator_void.depr_in_cxx17.fail.cpp
@@ -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;
 }

diff  --git a/libcxx/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.fail.cpp b/libcxx/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.fail.cpp
index 4e9a5312c22b..329b3acb2354 100644
--- a/libcxx/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.fail.cpp
+++ b/libcxx/test/libcxx/depr/depr.function.objects/adaptors.depr_in_cxx11.fail.cpp
@@ -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::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_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::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-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-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;
 }

diff  --git a/libcxx/test/libcxx/diagnostics/enable_nodiscard.fail.cpp b/libcxx/test/libcxx/diagnostics/enable_nodiscard.fail.cpp
index ca54ecac54b7..d579a4ccea8c 100644
--- a/libcxx/test/libcxx/diagnostics/enable_nodiscard.fail.cpp
+++ b/libcxx/test/libcxx/diagnostics/enable_nodiscard.fail.cpp
@@ -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();
 

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 0406418f7053..f4f74de52a10 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
@@ -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.
 

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 3caf3cf7947d..c2f29387b3be 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
@@ -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.
 

diff  --git a/libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.fail.cpp b/libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.fail.cpp
index fe1de0476e67..39861eddd85c 100644
--- a/libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.fail.cpp
+++ b/libcxx/test/libcxx/diagnostics/nodiscard_aftercxx17.fail.cpp
@@ -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;
 }

diff  --git a/libcxx/test/libcxx/diagnostics/nodiscard_extensions.fail.cpp b/libcxx/test/libcxx/diagnostics/nodiscard_extensions.fail.cpp
index 705b21c5af97..ef6e1fedfb88 100644
--- a/libcxx/test/libcxx/diagnostics/nodiscard_extensions.fail.cpp
+++ b/libcxx/test/libcxx/diagnostics/nodiscard_extensions.fail.cpp
@@ -38,260 +38,260 @@ struct P {
 int main(int, char**) {
   int arr[1] = { 1 };
 
-  // expected-error-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
   std::clamp(2, 1, 3);
 
-  // expected-error-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
   std::get_temporary_buffer<int>(1);
 
-  // expected-error-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
   std::max(1, 2);
 
-  // expected-error-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
   std::max(1, 2, std::greater<int>());
 
-  // expected-error-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
   std::max({1, 2, 3});
 
-  // expected-error-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
   std::max({1, 2, 3}, std::greater<int>());
 
-  // expected-error-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
   std::min(1, 2);
 
-  // expected-error-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
   std::min(1, 2, std::greater<int>());
 
-  // expected-error-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
   std::min({1, 2, 3});
 
-  // expected-error-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
   std::min({1, 2, 3}, std::greater<int>());
 
-  // expected-error-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
   std::minmax(1, 2);
 
-  // expected-error-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
   std::minmax(1, 2, std::greater<int>());
 
-  // expected-error-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
   std::minmax({1, 2, 3});
 
-  // expected-error-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
   std::minmax({1, 2, 3}, std::greater<int>());
 
-  // expected-error-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
   std::unique(std::begin(arr), std::end(arr));
 
-  // expected-error-re at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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 at +1 {{ignoring return value of function declared with {{'nodiscard'|warn_unused_result}} attribute}}
+  // expected-warning-re at +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;

diff  --git a/libcxx/test/libcxx/experimental/filesystem/deprecated.fail.cpp b/libcxx/test/libcxx/experimental/filesystem/deprecated.fail.cpp
index 0c583ad90aa9..4497bc2faf6a 100644
--- a/libcxx/test/libcxx/experimental/filesystem/deprecated.fail.cpp
+++ b/libcxx/test/libcxx/experimental/filesystem/deprecated.fail.cpp
@@ -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;

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 9fc4eff282b8..e14bcd979d90 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
@@ -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;
 }

diff  --git a/libcxx/test/libcxx/utilities/function.objects/func.wrap/depr_in_cxx03.fail.cpp b/libcxx/test/libcxx/utilities/function.objects/func.wrap/depr_in_cxx03.fail.cpp
index 282a7112cced..f8a162ce1bee 100644
--- a/libcxx/test/libcxx/utilities/function.objects/func.wrap/depr_in_cxx03.fail.cpp
+++ b/libcxx/test/libcxx/utilities/function.objects/func.wrap/depr_in_cxx03.fail.cpp
@@ -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}}
 }

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 71b18c9dad93..004309758a5d 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 4aeba89fb2e2..2492be582021 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 742ea3f248bb..abc67ed1e8d2 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 e181fd43f101..ba6aadca3d43 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 b39038df18c3..fa3476a0dbf2 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 f33fe8709e9f..6cd0a5e745e3 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 210094948d1a..fb107582780a 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 9e194cf2254f..49ad6a61037f 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 @@ int main(int, char**) {
     // expected-error at array:* {{to_array does not accept multidimensional arrays}}
     // expected-error at array:* {{to_array requires copy constructible elements}}
     // expected-error at array:* 3 {{cannot initialize}}
-    // expected-error at 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 cfb83c59b423..4afd901df639 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 @@ 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;
 }

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 560a27927ea9..1f38354d5a95 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 24ee897df207..da74faa6dca7 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 d396db60df41..d8b6216dd675 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 9db4b4ad893b..02d737b96726 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 ae4878cd7b6c..82195b24b502 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 640832b85bbd..1f39c7a6554c 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 72b4fd917cca..735ad197b4fd 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 1a19d33c74ed..d0eba659c8c6 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 4272e7abda58..2eeeafbd4738 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 65cde496c1a7..9efea4be0404 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 7a98e7991446..a1c8081436bd 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 b66ca3be9251..6a5bc321a009 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 8afc9eed6026..6ec5b6efd910 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 5d1452232465..1371fa10317b 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 3f3db027602f..98871f109409 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 8ccb54b4e12b..3f1179f2f10f 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 d6a4bb72b0b3..cd8ccb8eca70 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 78d62173dc07..2972e85a9136 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 10d52a1ae95b..45853b58a4a6 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 ebb7fc62448c..3c7ce2ed9213 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 8f465033439f..f620c4e99098 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 37a1a1d61725..bec35f579392 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 16f112c30fce..d58cf0d563d1 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 @@ 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}}

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 1316c47c3d02..f496e0fb415c 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 20fa674893c2..ff1abd589722 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 292868238f8a..cbb7b8f174da 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 4629bd393caa..19c17d23e891 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 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;
 }

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 91815b49b38d..59fb1b5e2eb4 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 5af4e4f19a5f..aa46da8da20f 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 1270482feec8..e6aa2377345f 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 @@ 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;
 }

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 e45605c8b30b..49be77d7c101 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 @@ 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;
 }

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 e73ee89b2ce3..6737badf8f00 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 @@ 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;
 }

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 1dc905510a74..6530c55b4c38 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 @@ 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;

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 4bf56e274f0b..0545b6d21850 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 @@ 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;
 }

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 88eaaa5c67d3..b24104d3411c 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 2d2e07157624..a6ce1141ad68 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 @@ int main(int, char**)
 #else
   // expected-error at +1 {{static_assert failed}}
   static_assert(!std::is_constant_evaluated(), "");
-  // expected-error at -1 0-1 {{'std::is_constant_evaluated' will always evaluate to 'true' in a manifestly constant-evaluated expression}}
+  // expected-warning at -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 7e3085a5b0fb..afb19b3c343b 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
 

diff  --git a/libcxx/utils/libcxx/test/format.py b/libcxx/utils/libcxx/test/format.py
index 754550756ca4..2776af182f71 100644
--- a/libcxx/utils/libcxx/test/format.py
+++ b/libcxx/utils/libcxx/test/format.py
@@ -238,9 +238,6 @@ def _evaluate_fail_test(self, test, test_cxx, parsers):
             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)


        


More information about the libcxx-commits mailing list