[libcxx-commits] [libcxx] dc71a77 - [libc++][NFC] Move several .fail.cpp tests to .verify.cpp
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Jun 19 06:06:52 PDT 2023
Author: Louis Dionne
Date: 2023-06-19T09:06:13-04:00
New Revision: dc71a77d33620830020c939bba25ebdfdd1b6194
URL: https://github.com/llvm/llvm-project/commit/dc71a77d33620830020c939bba25ebdfdd1b6194
DIFF: https://github.com/llvm/llvm-project/commit/dc71a77d33620830020c939bba25ebdfdd1b6194.diff
LOG: [libc++][NFC] Move several .fail.cpp tests to .verify.cpp
A few tests were also straightforward to translate to SFINAE tests
instead, so in a few cases I did that and removed the .fail.cpp test
entirely.
Differential Revision: https://reviews.llvm.org/D153149
Added:
libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.verify.cpp
libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.verify.cpp
libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.verify.cpp
libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.verify.cpp
libcxx/test/libcxx/input.output/string.streams/traits_mismatch.verify.cpp
libcxx/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.verify.cpp
libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.verify.cpp
libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.tuple_element.verify.cpp
libcxx/test/std/containers/sequences/array/array.tuple/get.verify.cpp
libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.verify.cpp
libcxx/test/std/language.support/support.dynamic/nothrow_t.verify.cpp
libcxx/test/std/thread/thread.mutex/thread.lock/types.verify.cpp
libcxx/test/std/utilities/memory/allocator.tag/allocator_arg.verify.cpp
libcxx/test/std/utilities/optional/optional.syn/optional_in_place_t.verify.cpp
libcxx/test/std/utilities/optional/optional.syn/optional_nullopt_t.verify.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.verify.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_Types.verify.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.verify.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_move.verify.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.verify.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.verify.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.verify.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.verify.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.verify.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.verify.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.verify.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.verify.cpp
Modified:
libcxx/test/std/containers/views/views.span/span.cons/array.pass.cpp
libcxx/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct_t.verify.cpp
libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.default.explicit_LWG2510.verify.cpp
Removed:
libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp
libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp
libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp
libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp
libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp
libcxx/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp
libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.fail.cpp
libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.tuple_element.fail.cpp
libcxx/test/std/containers/sequences/array/array.tuple/get.fail.cpp
libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.fail.cpp
libcxx/test/std/containers/views/views.span/span.cons/array.fail.cpp
libcxx/test/std/containers/views/views.span/span.cons/default.fail.cpp
libcxx/test/std/language.support/support.dynamic/nothrow_t.fail.cpp
libcxx/test/std/thread/thread.mutex/thread.lock/types.fail.cpp
libcxx/test/std/utilities/memory/allocator.tag/allocator_arg.fail.cpp
libcxx/test/std/utilities/optional/optional.syn/optional_in_place_t.fail.cpp
libcxx/test/std/utilities/optional/optional.syn/optional_nullopt_t.fail.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.fail.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_Types.fail.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.fail.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_move.fail.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.fail.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.fail.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.fail.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.fail.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.fail.cpp
libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.fail.cpp
################################################################################
diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp
deleted file mode 100644
index 27871b0c7bea5..0000000000000
--- a/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.fail.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <fstream>
-
-// template<class charT, class traits = char_traits<charT>>
-// class basic_filebuf;
-//
-// The char type of the stream and the char_type of the traits have to match
-
-// UNSUPPORTED: no-wide-characters
-
-#include <fstream>
-
-int main(int, char**)
-{
- std::basic_filebuf<char, std::char_traits<wchar_t> > f;
- // expected-error-re at streambuf:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
- // expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
- // expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
- // expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
- // expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
- // expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
- // expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
- // expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
- // expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
- // expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
-
- return 0;
-}
diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.verify.cpp b/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.verify.cpp
new file mode 100644
index 0000000000000..e6f651ca41d32
--- /dev/null
+++ b/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.verify.cpp
@@ -0,0 +1,30 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <fstream>
+
+// template<class charT, class traits = char_traits<charT>>
+// class basic_filebuf;
+//
+// The char type of the stream and the char_type of the traits have to match
+
+// UNSUPPORTED: no-wide-characters
+
+#include <fstream>
+
+std::basic_filebuf<char, std::char_traits<wchar_t> > f;
+// expected-error-re at streambuf:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
+// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.verify.cpp
similarity index 83%
rename from libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp
rename to libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.verify.cpp
index ce22fee618732..94299fe0af473 100644
--- a/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp
+++ b/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.verify.cpp
@@ -17,11 +17,9 @@
#include <fstream>
-int main(int, char**)
-{
- std::basic_fstream<char, std::char_traits<wchar_t> > f;
-// expected-error-re at ios:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
-// expected-error-re at streambuf:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
+std::basic_fstream<char, std::char_traits<wchar_t> > f;
+// expected-error-re at ios:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
+// expected-error-re at streambuf:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
// expected-error at fstream:* {{only virtual member functions can be marked 'override'}}
@@ -39,6 +37,3 @@ int main(int, char**)
// exception specifications for types which are already invalid for one reason or another.
// For now we tolerate this diagnostic.
// expected-error at ostream:* 0-1 {{exception specification of overriding function is more lax than base version}}
-
- return 0;
-}
diff --git a/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.verify.cpp
similarity index 69%
rename from libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp
rename to libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.verify.cpp
index 273dd0fe4c857..5789e8e2b07b1 100644
--- a/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.fail.cpp
+++ b/libcxx/test/libcxx/input.output/iostream.format/input.streams/traits_mismatch.verify.cpp
@@ -16,17 +16,10 @@
// UNSUPPORTED: no-wide-characters
#include <istream>
-#include <type_traits>
-#include <cassert>
+#include <string>
struct test_istream
: public std::basic_istream<char, std::char_traits<wchar_t> > {};
-
-int main(int, char**)
-{
-// expected-error-re at ios:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
-// expected-error at istream:* {{only virtual member functions can be marked 'override'}}
-
- return 0;
-}
+// expected-error-re at ios:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
+// expected-error at istream:* {{only virtual member functions can be marked 'override'}}
diff --git a/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.verify.cpp
similarity index 69%
rename from libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp
rename to libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.verify.cpp
index 9afcde0d8c68c..6f8ba7baaa1e2 100644
--- a/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.fail.cpp
+++ b/libcxx/test/libcxx/input.output/iostream.format/output.streams/traits_mismatch.verify.cpp
@@ -16,17 +16,10 @@
// UNSUPPORTED: no-wide-characters
#include <ostream>
-#include <type_traits>
-#include <cassert>
+#include <string>
struct test_ostream
: public std::basic_ostream<char, std::char_traits<wchar_t> > {};
-
-int main(int, char**)
-{
-// expected-error-re at ios:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
-// expected-error at ostream:* {{only virtual member functions can be marked 'override'}}
-
- return 0;
-}
+// expected-error-re at ios:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
+// expected-error at ostream:* {{only virtual member functions can be marked 'override'}}
diff --git a/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp
deleted file mode 100644
index 23ab5f0c88a0b..0000000000000
--- a/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.fail.cpp
+++ /dev/null
@@ -1,34 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-// <sstream>
-
-// template<class charT, class traits = char_traits<charT>,
-// class Allocator = allocator<charT>>
-// class basic_stringbuf;
-//
-// The char type of the stream and the char_type of the traits have to match
-
-// UNSUPPORTED: no-wide-characters
-
-#include <sstream>
-
-int main(int, char**)
-{
- std::basic_stringbuf<char, std::char_traits<wchar_t> > sb;
-// expected-error-re at streambuf:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
-// expected-error-re at string:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
-
- // expected-error at sstream:* {{only virtual member functions can be marked 'override'}}
- // expected-error at sstream:* {{only virtual member functions can be marked 'override'}}
- // expected-error at sstream:* {{only virtual member functions can be marked 'override'}}
- // expected-error at sstream:* {{only virtual member functions can be marked 'override'}}
- // expected-error at sstream:* {{only virtual member functions can be marked 'override'}}
-
- return 0;
-}
diff --git a/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.verify.cpp b/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.verify.cpp
new file mode 100644
index 0000000000000..36c4b23eb2978
--- /dev/null
+++ b/libcxx/test/libcxx/input.output/string.streams/traits_mismatch.verify.cpp
@@ -0,0 +1,29 @@
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+// <sstream>
+
+// template<class charT, class traits = char_traits<charT>,
+// class Allocator = allocator<charT>>
+// class basic_stringbuf;
+//
+// The char type of the stream and the char_type of the traits have to match
+
+// UNSUPPORTED: no-wide-characters
+
+#include <sstream>
+
+std::basic_stringbuf<char, std::char_traits<wchar_t> > sb;
+// expected-error-re at streambuf:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
+// expected-error-re at string:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}}
+
+// expected-error at sstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at sstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at sstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at sstream:* {{only virtual member functions can be marked 'override'}}
+// expected-error at sstream:* {{only virtual member functions can be marked 'override'}}
diff --git a/libcxx/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp b/libcxx/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.verify.cpp
similarity index 95%
rename from libcxx/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp
rename to libcxx/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.verify.cpp
index 07a51b5db90cf..bab686e7b4ca2 100644
--- a/libcxx/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.fail.cpp
+++ b/libcxx/test/libcxx/thread/thread.mutex/thread_safety_missing_unlock.verify.cpp
@@ -21,8 +21,6 @@
std::mutex m;
-int main(int, char**) {
+void f() {
m.lock();
-
- return 0;
} // expected-error {{mutex 'm' is still held at the end of function}}
diff --git a/libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.fail.cpp b/libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.verify.cpp
similarity index 97%
rename from libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.fail.cpp
rename to libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.verify.cpp
index 2586c32ca80ec..4a6e3095c1019 100644
--- a/libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.fail.cpp
+++ b/libcxx/test/libcxx/utilities/tuple/tuple.tuple/tuple.cnstr/PR20855_tuple_ref_binding_diagnostics.verify.cpp
@@ -10,7 +10,7 @@
// <tuple>
-// See llvm.org/PR20855
+// See https://llvm.org/PR20855
#include <tuple>
#include <string>
@@ -39,7 +39,7 @@ template <class ...Args>
void F(typename CannotDeduce<std::tuple<Args...>>::type const&) {}
-int main(int, char**) {
+void f() {
#if TEST_HAS_BUILTIN_IDENTIFIER(__reference_binds_to_temporary)
// Test that we emit our diagnostic from the library.
// expected-error at tuple:* 8 {{Attempted construction of reference element binds to a temporary whose lifetime has ended}}
@@ -77,6 +77,4 @@ int main(int, char**) {
#error force failure
// expected-error at -1 {{force failure}}
#endif
-
- return 0;
}
diff --git a/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.tuple_element.fail.cpp b/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.tuple_element.verify.cpp
similarity index 58%
rename from libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.tuple_element.fail.cpp
rename to libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.tuple_element.verify.cpp
index 40e57df508959..c21afe5caae25 100644
--- a/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.tuple_element.fail.cpp
+++ b/libcxx/test/libcxx/utilities/utility/pairs/pairs.pair/pair.tuple_element.verify.cpp
@@ -14,13 +14,8 @@
#include <utility>
-int main(int, char**)
-{
- {
- typedef std::pair<int, double> P;
- std::tuple_element<2, P>::type foo; // expected-note {{requested here}}
- // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{( due to requirement '2U[L]{0,2} < 2')?}}{{.*}}Index out of bounds in std::tuple_element<std::pair<T1, T2>>}}
- }
-
- return 0;
+void f() {
+ typedef std::pair<int, double> P;
+ std::tuple_element<2, P>::type foo; // expected-note {{requested here}}
+ // expected-error-re@*:* {{{{(static_assert|static assertion)}} failed{{( due to requirement '2U[L]{0,2} < 2')?}}{{.*}}Index out of bounds in std::tuple_element<std::pair<T1, T2>>}}
}
diff --git a/libcxx/test/std/containers/sequences/array/array.tuple/get.fail.cpp b/libcxx/test/std/containers/sequences/array/array.tuple/get.verify.cpp
similarity index 59%
rename from libcxx/test/std/containers/sequences/array/array.tuple/get.fail.cpp
rename to libcxx/test/std/containers/sequences/array/array.tuple/get.verify.cpp
index 2e1071550a51c..a447a1113d4af 100644
--- a/libcxx/test/std/containers/sequences/array/array.tuple/get.fail.cpp
+++ b/libcxx/test/std/containers/sequences/array/array.tuple/get.verify.cpp
@@ -16,17 +16,10 @@
#include <array>
#include <cassert>
-#include "test_macros.h"
-
-int main(int, char**)
-{
- {
- typedef double T;
- typedef std::array<T, 3> C;
- C c = {1, 2, 3.5};
- std::get<3>(c) = 5.5; // expected-note {{requested here}}
- // expected-error-re at array:* {{{{(static_assert|static assertion)}} failed{{( due to requirement '3U[L]{0,2} < 3U[L]{0,2}')?}}{{.*}}Index out of bounds in std::get<> (std::array)}}
- }
-
- return 0;
+void f() {
+ typedef double T;
+ typedef std::array<T, 3> C;
+ C c = {1, 2, 3.5};
+ std::get<3>(c) = 5.5; // expected-note {{requested here}}
+ // expected-error-re at array:* {{{{(static_assert|static assertion)}} failed{{( due to requirement '3U[L]{0,2} < 3U[L]{0,2}')?}}{{.*}}Index out of bounds in std::get<> (std::array)}}
}
diff --git a/libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.fail.cpp b/libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.verify.cpp
similarity index 54%
rename from libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.fail.cpp
rename to libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.verify.cpp
index 6010c893d6995..e0ae7f10fbb2f 100644
--- a/libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.fail.cpp
+++ b/libcxx/test/std/containers/sequences/array/array.tuple/tuple_element.verify.cpp
@@ -13,14 +13,7 @@
#include <array>
#include <cassert>
-int main(int, char**)
-{
- {
- typedef double T;
- typedef std::array<T, 3> C;
- std::tuple_element<3, C> foo; // expected-note {{requested here}}
- // expected-error-re at array:* {{{{(static_assert|static assertion)}} failed{{( due to requirement '3U[L]{0,2} < 3U[L]{0,2}')?}}{{.*}}Index out of bounds in std::tuple_element<> (std::array)}}
- }
-
- return 0;
-}
+typedef double T;
+typedef std::array<T, 3> C;
+std::tuple_element<3, C> foo; // expected-note {{requested here}}
+// expected-error-re at array:* {{{{(static_assert|static assertion)}} failed{{( due to requirement '3U[L]{0,2} < 3U[L]{0,2}')?}}{{.*}}Index out of bounds in std::tuple_element<> (std::array)}}
diff --git a/libcxx/test/std/containers/views/views.span/span.cons/array.fail.cpp b/libcxx/test/std/containers/views/views.span/span.cons/array.fail.cpp
deleted file mode 100644
index 74682167c6d27..0000000000000
--- a/libcxx/test/std/containers/views/views.span/span.cons/array.fail.cpp
+++ /dev/null
@@ -1,72 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03, c++11, c++14, c++17
-
-// <span>
-
-// template<size_t N>
-// constexpr span(element_type (&arr)[N]) noexcept;
-// template<size_t N>
-// constexpr span(array<value_type, N>& arr) noexcept;
-// template<size_t N>
-// constexpr span(const array<value_type, N>& arr) noexcept;
-//
-// Remarks: These constructors shall not participate in overload resolution unless:
-// - extent == dynamic_extent || N == extent is true, and
-// - remove_pointer_t<decltype(data(arr))>(*)[] is convertible to ElementType(*)[].
-//
-
-
-#include <span>
-#include <cassert>
-#include <string>
-
-#include "test_macros.h"
-
- int arr[] = {1,2,3};
-const int carr[] = {4,5,6};
- volatile int varr[] = {7,8,9};
-const volatile int cvarr[] = {1,3,5};
-
-int main(int, char**)
-{
-// Size wrong
- {
- std::span<int, 2> s1(arr); // expected-error {{no matching constructor for initialization of 'std::span<int, 2>'}}
- }
-
-// Type wrong
- {
- std::span<float> s1(arr); // expected-error {{no matching constructor for initialization of 'std::span<float>'}}
- std::span<float, 3> s2(arr); // expected-error {{no matching constructor for initialization of 'std::span<float, 3>'}}
- }
-
-// CV wrong (dynamically sized)
- {
- std::span< int> s1{ carr}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
- std::span< int> s2{ varr}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
- std::span< int> s3{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span<int>'}}
- std::span<const int> s4{ varr}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}}
- std::span<const int> s5{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span<const int>'}}
- std::span< volatile int> s6{ carr}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}}
- std::span< volatile int> s7{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int>'}}
- }
-
-// CV wrong (statically sized)
- {
- std::span< int,3> s1{ carr}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}}
- std::span< int,3> s2{ varr}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}}
- std::span< int,3> s3{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span<int, 3>'}}
- std::span<const int,3> s4{ varr}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 3>'}}
- std::span<const int,3> s5{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span<const int, 3>'}}
- std::span< volatile int,3> s6{ carr}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 3>'}}
- std::span< volatile int,3> s7{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span<volatile int, 3>'}}
- }
-
- return 0;
-}
diff --git a/libcxx/test/std/containers/views/views.span/span.cons/array.pass.cpp b/libcxx/test/std/containers/views/views.span/span.cons/array.pass.cpp
index ce03c4fa92475..8fa7692c3b637 100644
--- a/libcxx/test/std/containers/views/views.span/span.cons/array.pass.cpp
+++ b/libcxx/test/std/containers/views/views.span/span.cons/array.pass.cpp
@@ -17,10 +17,10 @@
// - remove_pointer_t<decltype(data(arr))>(*)[] is convertible to ElementType(*)[].
//
-
-#include <span>
#include <cassert>
+#include <span>
#include <string>
+#include <type_traits>
#include "test_macros.h"
@@ -117,5 +117,42 @@ int main(int, char**)
checkCV();
+ // Size wrong
+ {
+ static_assert(!std::is_constructible<std::span<int, 2>, int (&)[3]>::value, "");
+ }
+
+ // Type wrong
+ {
+ static_assert(!std::is_constructible<std::span<float>, int (&)[3]>::value, "");
+ static_assert(!std::is_constructible<std::span<float, 3>, int (&)[3]>::value, "");
+ }
+
+ // CV wrong (dynamically sized)
+ {
+ static_assert(!std::is_constructible<std::span<int>, const int (&)[3]>::value, "");
+ static_assert(!std::is_constructible<std::span<int>, volatile int (&)[3]>::value, "");
+ static_assert(!std::is_constructible<std::span<int>, const volatile int (&)[3]>::value, "");
+
+ static_assert(!std::is_constructible<std::span<const int>, volatile int (&)[3]>::value, "");
+ static_assert(!std::is_constructible<std::span<const int>, const volatile int (&)[3]>::value, "");
+
+ static_assert(!std::is_constructible<std::span<volatile int>, const int (&)[3]>::value, "");
+ static_assert(!std::is_constructible<std::span<volatile int>, const volatile int (&)[3]>::value, "");
+ }
+
+ // CV wrong (statically sized)
+ {
+ static_assert(!std::is_constructible<std::span<int, 3>, const int (&)[3]>::value, "");
+ static_assert(!std::is_constructible<std::span<int, 3>, volatile int (&)[3]>::value, "");
+ static_assert(!std::is_constructible<std::span<int, 3>, const volatile int (&)[3]>::value, "");
+
+ static_assert(!std::is_constructible<std::span<const int, 3>, volatile int (&)[3]>::value, "");
+ static_assert(!std::is_constructible<std::span<const int, 3>, const volatile int (&)[3]>::value, "");
+
+ static_assert(!std::is_constructible<std::span<volatile int, 3>, const int (&)[3]>::value, "");
+ static_assert(!std::is_constructible<std::span<volatile int, 3>, const volatile int (&)[3]>::value, "");
+ }
+
return 0;
}
diff --git a/libcxx/test/std/containers/views/views.span/span.cons/default.fail.cpp b/libcxx/test/std/containers/views/views.span/span.cons/default.fail.cpp
deleted file mode 100644
index 2c62278aac867..0000000000000
--- a/libcxx/test/std/containers/views/views.span/span.cons/default.fail.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-//===----------------------------------------------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-// UNSUPPORTED: c++03, c++11, c++14, c++17
-
-// <span>
-
-// constexpr span() noexcept;
-//
-// Remarks: This constructor shall not participate in overload resolution
-// unless Extent == 0 || Extent == dynamic_extent is true.
-
-
-#include <span>
-#include <cassert>
-#include <string>
-
-#include "test_macros.h"
-
-int main(int, char**)
-{
- std::span<int, 2> s; // expected-error {{no matching constructor for initialization of 'std::span<int, 2>'}}
-
- return 0;
-}
diff --git a/libcxx/test/std/language.support/support.dynamic/nothrow_t.fail.cpp b/libcxx/test/std/language.support/support.dynamic/nothrow_t.verify.cpp
similarity index 88%
rename from libcxx/test/std/language.support/support.dynamic/nothrow_t.fail.cpp
rename to libcxx/test/std/language.support/support.dynamic/nothrow_t.verify.cpp
index 5ec2696a3c9c2..50dd63a6350f0 100644
--- a/libcxx/test/std/language.support/support.dynamic/nothrow_t.fail.cpp
+++ b/libcxx/test/std/language.support/support.dynamic/nothrow_t.verify.cpp
@@ -14,13 +14,8 @@
// };
// extern const nothrow_t nothrow;
-// This test checks for LWG 2510.
+// This test checks for https://wg21.link/LWG2510.
#include <new>
-
std::nothrow_t f() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
-
-int main(int, char**) {
- return 0;
-}
diff --git a/libcxx/test/std/thread/thread.mutex/thread.lock/types.fail.cpp b/libcxx/test/std/thread/thread.mutex/thread.lock/types.verify.cpp
similarity index 92%
rename from libcxx/test/std/thread/thread.mutex/thread.lock/types.fail.cpp
rename to libcxx/test/std/thread/thread.mutex/thread.lock/types.verify.cpp
index b4acac85b7e30..623e5c3d22e75 100644
--- a/libcxx/test/std/thread/thread.mutex/thread.lock/types.fail.cpp
+++ b/libcxx/test/std/thread/thread.mutex/thread.lock/types.verify.cpp
@@ -16,15 +16,10 @@
// struct try_to_lock_t { explicit try_to_lock_t() = default; };
// struct adopt_lock_t { explicit adopt_lock_t() = default; };
-// This test checks for LWG 2510.
+// This test checks for https://wg21.link/LWG2510.
#include <mutex>
-
std::defer_lock_t f1() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
std::try_to_lock_t f2() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
std::adopt_lock_t f3() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
-
-int main(int, char**) {
- return 0;
-}
diff --git a/libcxx/test/std/utilities/memory/allocator.tag/allocator_arg.fail.cpp b/libcxx/test/std/utilities/memory/allocator.tag/allocator_arg.verify.cpp
similarity index 89%
rename from libcxx/test/std/utilities/memory/allocator.tag/allocator_arg.fail.cpp
rename to libcxx/test/std/utilities/memory/allocator.tag/allocator_arg.verify.cpp
index 94752af96fa27..db5a85aa752bd 100644
--- a/libcxx/test/std/utilities/memory/allocator.tag/allocator_arg.fail.cpp
+++ b/libcxx/test/std/utilities/memory/allocator.tag/allocator_arg.verify.cpp
@@ -13,13 +13,8 @@
// struct allocator_arg_t { explicit allocator_arg_t() = default; };
// const allocator_arg_t allocator_arg = allocator_arg_t();
-// This test checks for LWG 2510.
+// This test checks for https://wg21.link/LWG2510.
#include <memory>
-
std::allocator_arg_t f() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
-
-int main(int, char**) {
- return 0;
-}
diff --git a/libcxx/test/std/utilities/optional/optional.syn/optional_in_place_t.fail.cpp b/libcxx/test/std/utilities/optional/optional.syn/optional_in_place_t.verify.cpp
similarity index 78%
rename from libcxx/test/std/utilities/optional/optional.syn/optional_in_place_t.fail.cpp
rename to libcxx/test/std/utilities/optional/optional.syn/optional_in_place_t.verify.cpp
index b95cb5606b5f2..20efef515c362 100644
--- a/libcxx/test/std/utilities/optional/optional.syn/optional_in_place_t.fail.cpp
+++ b/libcxx/test/std/utilities/optional/optional.syn/optional_in_place_t.verify.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
+
// <optional>
// A program that necessitates the instantiation of template optional for
@@ -14,14 +15,7 @@
#include <optional>
-int main(int, char**)
-{
- using std::optional;
- using std::in_place_t;
- using std::in_place;
-
- optional<in_place_t> opt; // expected-note {{requested here}}
+void f() {
+ std::optional<std::in_place_t> opt; // expected-note {{requested here}}
// expected-error at optional:* {{instantiation of optional with in_place_t is ill-formed}}
-
- return 0;
}
diff --git a/libcxx/test/std/utilities/optional/optional.syn/optional_nullopt_t.fail.cpp b/libcxx/test/std/utilities/optional/optional.syn/optional_nullopt_t.verify.cpp
similarity index 62%
rename from libcxx/test/std/utilities/optional/optional.syn/optional_nullopt_t.fail.cpp
rename to libcxx/test/std/utilities/optional/optional.syn/optional_nullopt_t.verify.cpp
index 044c4e66572aa..f807da7470ae9 100644
--- a/libcxx/test/std/utilities/optional/optional.syn/optional_nullopt_t.fail.cpp
+++ b/libcxx/test/std/utilities/optional/optional.syn/optional_nullopt_t.verify.cpp
@@ -7,6 +7,7 @@
//===----------------------------------------------------------------------===//
// UNSUPPORTED: c++03, c++11, c++14
+
// <optional>
// A program that necessitates the instantiation of template optional for
@@ -14,17 +15,10 @@
#include <optional>
-int main(int, char**)
-{
- using std::optional;
- using std::nullopt_t;
- using std::nullopt;
-
- optional<nullopt_t> opt; // expected-note 1 {{requested here}}
- optional<const nullopt_t> opt1; // expected-note 1 {{requested here}}
- optional<nullopt_t &> opt2; // expected-note 1 {{requested here}}
- optional<nullopt_t &&> opt3; // expected-note 1 {{requested here}}
+void f() {
+ std::optional<std::nullopt_t> opt; // expected-note 1 {{requested here}}
+ std::optional<const std::nullopt_t> opt1; // expected-note 1 {{requested here}}
+ std::optional<std::nullopt_t &> opt2; // expected-note 1 {{requested here}}
+ std::optional<std::nullopt_t &&> opt3; // expected-note 1 {{requested here}}
// expected-error at optional:* 4 {{instantiation of optional with nullopt_t is ill-formed}}
-
- return 0;
}
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.fail.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.verify.cpp
similarity index 95%
rename from libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.fail.cpp
rename to libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.verify.cpp
index 2a89996937220..0ce92da28cc42 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.fail.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc.verify.cpp
@@ -27,7 +27,3 @@ struct ExplicitDefault { explicit ExplicitDefault() { } };
std::tuple<ExplicitDefault> explicit_default_test() {
return {std::allocator_arg, std::allocator<int>()}; // expected-error {{chosen constructor is explicit in copy-initialization}}
}
-
-int main(int, char**) {
- return 0;
-}
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_Types.fail.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_Types.verify.cpp
similarity index 91%
rename from libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_Types.fail.cpp
rename to libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_Types.verify.cpp
index 1a1e8d2f9d54c..21ec4e07053ca 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_Types.fail.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_const_Types.verify.cpp
@@ -35,10 +35,3 @@ std::tuple<ExplicitCopy> non_const_explicity_copy_test() {
return {std::allocator_arg, std::allocator<int>{}, e};
// expected-error at -1 {{chosen constructor is explicit in copy-initialization}}
}
-int main(int, char**)
-{
- const_explicit_copy_test();
- non_const_explicity_copy_test();
-
- return 0;
-}
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.fail.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.verify.cpp
similarity index 96%
rename from libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.fail.cpp
rename to libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.verify.cpp
index b5b7de75344aa..ec8490787294c 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.fail.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_copy.verify.cpp
@@ -35,10 +35,3 @@ std::tuple<ExplicitCopy> non_const_explicit_copy_test() {
return {std::allocator_arg, std::allocator<int>{}, t1};
// expected-error at -1 {{chosen constructor is explicit in copy-initialization}}
}
-
-int main(int, char**)
-{
-
-
- return 0;
-}
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_move.fail.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_move.verify.cpp
similarity index 95%
rename from libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_move.fail.cpp
rename to libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_move.verify.cpp
index 9202086cdae11..0fa60d54a23b0 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_move.fail.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_move.verify.cpp
@@ -28,10 +28,3 @@ std::tuple<ExplicitCopy> explicit_move_test() {
return {std::allocator_arg, std::allocator<int>{}, std::move(t1)};
// expected-error at -1 {{chosen constructor is explicit in copy-initialization}}
}
-
-int main(int, char**)
-{
-
-
- return 0;
-}
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.fail.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.verify.cpp
similarity index 96%
rename from libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.fail.cpp
rename to libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.verify.cpp
index 7b5773e183ae0..ab35585a02993 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.fail.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.verify.cpp
@@ -41,9 +41,3 @@ std::tuple<ExplicitCopy> const_explicit_copy_no_brace() {
return e;
// expected-error at -1 {{no viable conversion}}
}
-
-int main(int, char**)
-{
-
- return 0;
-}
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.fail.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.verify.cpp
similarity index 98%
rename from libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.fail.cpp
rename to libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.verify.cpp
index ed49c739d2baf..61951d80dad26 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.fail.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/default.verify.cpp
@@ -43,7 +43,3 @@ std::tuple<Explicit, Implicit, Implicit> test12() { return {}; } // expected-err
std::tuple<Explicit, Implicit, Explicit> test13() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
std::tuple<Explicit, Explicit, Implicit> test14() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
std::tuple<Explicit, Explicit, Explicit> test15() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}}
-
-int main(int, char**) {
- return 0;
-}
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.fail.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.verify.cpp
similarity index 87%
rename from libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.fail.cpp
rename to libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.verify.cpp
index ff1e37db8e6ad..2595ea871d5b1 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.fail.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/get_const_rv.verify.cpp
@@ -23,13 +23,10 @@ template <class T> void cref(T const&&) = delete;
std::tuple<int> const tup4() { return std::make_tuple(4); }
-int main(int, char**)
-{
+void f() {
// LWG2485: tuple should not open a hole in the type system, get() should
// imitate [expr.ref]'s rules for accessing data members
{
- cref(std::get<0>(tup4())); // expected-error {{call to deleted function 'cref'}}
+ cref(std::get<0>(tup4())); // expected-error {{call to deleted function 'cref'}}
}
-
- return 0;
}
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.verify.cpp
similarity index 97%
rename from libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp
rename to libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.verify.cpp
index 4fef6b99f5305..1d05eb5fe76e9 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.fail.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.elem/tuple.by.type.verify.cpp
@@ -33,10 +33,7 @@ void test_bad_return_type() {
upint p = std::get<upint>(t); // expected-error{{deleted copy constructor}}
}
-int main(int, char**)
-{
+void f() {
test_bad_index();
test_bad_return_type();
-
- return 0;
}
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.fail.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.verify.cpp
similarity index 59%
rename from libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.fail.cpp
rename to libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.verify.cpp
index 21b69683b680a..03eb8f40280a4 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.fail.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_element.verify.cpp
@@ -19,15 +19,8 @@
// UNSUPPORTED: c++03
#include <tuple>
-#include <type_traits>
-int main(int, char**)
-{
- using T = std::tuple<int, long, void*>;
- using E1 = typename std::tuple_element<1, T &>::type; // expected-error{{undefined template}}
- using E2 = typename std::tuple_element<3, T>::type;
- using E3 = typename std::tuple_element<4, T const>::type;
- // expected-error-re@*:* 2 {{{{(static_assert|static assertion)}} failed}}
-
- return 0;
-}
+using T = std::tuple<int, long, void*>;
+using E1 = typename std::tuple_element<1, T &>::type; // expected-error{{undefined template}}
+using E2 = typename std::tuple_element<3, T>::type;
+using E3 = typename std::tuple_element<4, T const>::type; // expected-error-re@*:* 2 {{{{(static_assert|static assertion)}} failed}}
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.verify.cpp
similarity index 96%
rename from libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp
rename to libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.verify.cpp
index 2a4374570eced..27a821ad3bf2e 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.fail.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size.verify.cpp
@@ -18,11 +18,8 @@
#include <tuple>
-int main(int, char**)
-{
+void f() {
(void)std::tuple_size<std::tuple<> &>::value; // expected-error {{implicit instantiation of undefined template}}
(void)std::tuple_size<int>::value; // expected-error {{implicit instantiation of undefined template}}
(void)std::tuple_size<std::tuple<>*>::value; // expected-error {{implicit instantiation of undefined template}}
-
- return 0;
}
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.fail.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.verify.cpp
similarity index 97%
rename from libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.fail.cpp
rename to libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.verify.cpp
index a2a65e0ebb8b5..532ccd730ffc1 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.fail.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_incomplete.verify.cpp
@@ -39,8 +39,7 @@ struct std::tuple_size<Dummy2> {
template <>
struct std::tuple_size<Dummy3> {};
-int main(int, char**)
-{
+void f() {
// Test that tuple_size<const T> is not incomplete when tuple_size<T>::value
// is well-formed but not a constant expression.
{
@@ -59,6 +58,4 @@ int main(int, char**)
// expected-error@*:* 1 {{no member named 'value'}}
(void)std::tuple_size<const Dummy3>::value; // expected-note {{here}}
}
-
- return 0;
}
diff --git a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.fail.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.verify.cpp
similarity index 96%
rename from libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.fail.cpp
rename to libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.verify.cpp
index 6b1ee6884b39b..7570230b4b074 100644
--- a/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.fail.cpp
+++ b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.helper/tuple_size_v.verify.cpp
@@ -16,12 +16,9 @@
#include <tuple>
-int main(int, char**)
-{
+void f() {
(void)std::tuple_size_v<std::tuple<> &>; // expected-note {{requested here}}
(void)std::tuple_size_v<int>; // expected-note {{requested here}}
(void)std::tuple_size_v<std::tuple<>*>; // expected-note {{requested here}}
// expected-error at tuple:* 3 {{implicit instantiation of undefined template}}
-
- return 0;
}
diff --git a/libcxx/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct_t.verify.cpp b/libcxx/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct_t.verify.cpp
index a72a99da4e9dd..fff5044866d91 100644
--- a/libcxx/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct_t.verify.cpp
+++ b/libcxx/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct_t.verify.cpp
@@ -13,7 +13,7 @@
// struct piecewise_construct_t { explicit piecewise_construct_t() = default; };
// constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
-// This test checks for LWG 2510.
+// This test checks for https://wg21.link/LWG2510.
#include <utility>
diff --git a/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.default.explicit_LWG2510.verify.cpp b/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.default.explicit_LWG2510.verify.cpp
index 50a4eb74800a0..18b9ab32887aa 100644
--- a/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.default.explicit_LWG2510.verify.cpp
+++ b/libcxx/test/std/utilities/utility/pairs/pairs.pair/ctor.default.explicit_LWG2510.verify.cpp
@@ -15,7 +15,7 @@
// explicit(see-below) constexpr pair();
// This test checks the conditional explicitness of std::pair's default
-// constructor as introduced by the resolution of LWG 2510.
+// constructor as introduced by the resolution of https://wg21.link/LWG2510.
#include <utility>
More information about the libcxx-commits
mailing list