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 --- 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 -// -//===----------------------------------------------------------------------===// - -// - -// template> -// class basic_filebuf; -// -// The char type of the stream and the char_type of the traits have to match - -// UNSUPPORTED: no-wide-characters - -#include - -int main(int, char**) -{ - std::basic_filebuf > f; - // expected-error-re@streambuf:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}} - // expected-error@fstream:* {{only virtual member functions can be marked 'override'}} - // expected-error@fstream:* {{only virtual member functions can be marked 'override'}} - // expected-error@fstream:* {{only virtual member functions can be marked 'override'}} - // expected-error@fstream:* {{only virtual member functions can be marked 'override'}} - // expected-error@fstream:* {{only virtual member functions can be marked 'override'}} - // expected-error@fstream:* {{only virtual member functions can be marked 'override'}} - // expected-error@fstream:* {{only virtual member functions can be marked 'override'}} - // expected-error@fstream:* {{only virtual member functions can be marked 'override'}} - // expected-error@fstream:* {{only virtual member functions can be marked 'override'}} - - return 0; -} diff --git a/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp b/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.verify.cpp rename from libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp rename to libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.verify.cpp --- a/libcxx/test/libcxx/input.output/file.streams/fstreams/traits_mismatch.fail.cpp +++ b/libcxx/test/libcxx/input.output/file.streams/fstreams/filebuf/traits_mismatch.verify.cpp @@ -8,21 +8,17 @@ // -// template > -// class basic_fstream - +// template> +// class basic_filebuf; +// // The char type of the stream and the char_type of the traits have to match // UNSUPPORTED: no-wide-characters #include -int main(int, char**) -{ - std::basic_fstream > f; -// expected-error-re@ios:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}} -// expected-error-re@streambuf:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}} - +std::basic_filebuf > f; +// expected-error-re@streambuf:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}} // expected-error@fstream:* {{only virtual member functions can be marked 'override'}} // expected-error@fstream:* {{only virtual member functions can be marked 'override'}} // expected-error@fstream:* {{only virtual member functions can be marked 'override'}} @@ -32,13 +28,3 @@ // expected-error@fstream:* {{only virtual member functions can be marked 'override'}} // expected-error@fstream:* {{only virtual member functions can be marked 'override'}} // expected-error@fstream:* {{only virtual member functions can be marked 'override'}} -// expected-error@istream:* {{only virtual member functions can be marked 'override'}} -// expected-error@istream:* {{only virtual member functions can be marked 'override'}} - -// FIXME: As of commit r324062 Clang incorrectly generates a diagnostic about mismatching -// exception specifications for types which are already invalid for one reason or another. -// For now we tolerate this diagnostic. -// expected-error@ostream:* 0-1 {{exception specification of overriding function is more lax than base version}} - - return 0; -} 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 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 --- 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 -int main(int, char**) -{ - std::basic_fstream > f; -// expected-error-re@ios:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}} -// expected-error-re@streambuf:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}} +std::basic_fstream > f; +// expected-error-re@ios:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}} +// expected-error-re@streambuf:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}} // expected-error@fstream:* {{only virtual member functions can be marked 'override'}} // expected-error@fstream:* {{only virtual member functions can be marked 'override'}} @@ -39,6 +37,3 @@ // exception specifications for types which are already invalid for one reason or another. // For now we tolerate this diagnostic. // expected-error@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 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 --- 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 -#include -#include +#include struct test_istream : public std::basic_istream > {}; - -int main(int, char**) -{ -// expected-error-re@ios:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}} -// expected-error@istream:* {{only virtual member functions can be marked 'override'}} - - return 0; -} +// expected-error-re@ios:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}} +// expected-error@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 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 --- 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 -#include -#include +#include struct test_ostream : public std::basic_ostream > {}; - -int main(int, char**) -{ -// expected-error-re@ios:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}} -// expected-error@ostream:* {{only virtual member functions can be marked 'override'}} - - return 0; -} +// expected-error-re@ios:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}} +// expected-error@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 --- 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 -// -//===----------------------------------------------------------------------===// - -// - -// template, -// class Allocator = allocator> -// class basic_stringbuf; -// -// The char type of the stream and the char_type of the traits have to match - -// UNSUPPORTED: no-wide-characters - -#include - -int main(int, char**) -{ - std::basic_stringbuf > sb; -// expected-error-re@streambuf:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}} -// expected-error-re@string:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}} - - // expected-error@sstream:* {{only virtual member functions can be marked 'override'}} - // expected-error@sstream:* {{only virtual member functions can be marked 'override'}} - // expected-error@sstream:* {{only virtual member functions can be marked 'override'}} - // expected-error@sstream:* {{only virtual member functions can be marked 'override'}} - // expected-error@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 --- /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 +// +//===----------------------------------------------------------------------===// + +// + +// template, +// class Allocator = allocator> +// class basic_stringbuf; +// +// The char type of the stream and the char_type of the traits have to match + +// UNSUPPORTED: no-wide-characters + +#include + +std::basic_stringbuf > sb; +// expected-error-re@streambuf:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}} +// expected-error-re@string:* {{{{(static_assert|static assertion)}} failed{{.*}}traits_type::char_type must be the same type as CharT}} + +// expected-error@sstream:* {{only virtual member functions can be marked 'override'}} +// expected-error@sstream:* {{only virtual member functions can be marked 'override'}} +// expected-error@sstream:* {{only virtual member functions can be marked 'override'}} +// expected-error@sstream:* {{only virtual member functions can be marked 'override'}} +// expected-error@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 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 --- 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 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 --- 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 @@ // -// See llvm.org/PR20855 +// See https://llvm.org/PR20855 #include #include @@ -39,7 +39,7 @@ void F(typename CannotDeduce>::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@tuple:* 8 {{Attempted construction of reference element binds to a temporary whose lifetime has ended}} @@ -77,6 +77,4 @@ #error force failure // expected-error@-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 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 --- 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 -int main(int, char**) -{ - { - typedef std::pair 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>}} - } - - return 0; +void f() { + typedef std::pair 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>}} } 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 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 --- 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 #include -#include "test_macros.h" - -int main(int, char**) -{ - { - typedef double T; - typedef std::array C; - C c = {1, 2, 3.5}; - std::get<3>(c) = 5.5; // expected-note {{requested here}} - // expected-error-re@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 C; + C c = {1, 2, 3.5}; + std::get<3>(c) = 5.5; // expected-note {{requested here}} + // expected-error-re@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 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 --- 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 #include -int main(int, char**) -{ - { - typedef double T; - typedef std::array C; - std::tuple_element<3, C> foo; // expected-note {{requested here}} - // expected-error-re@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 C; +std::tuple_element<3, C> foo; // expected-note {{requested here}} +// expected-error-re@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 --- 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 - -// - -// template -// constexpr span(element_type (&arr)[N]) noexcept; -// template -// constexpr span(array& arr) noexcept; -// template -// constexpr span(const array& arr) noexcept; -// -// Remarks: These constructors shall not participate in overload resolution unless: -// - extent == dynamic_extent || N == extent is true, and -// - remove_pointer_t(*)[] is convertible to ElementType(*)[]. -// - - -#include -#include -#include - -#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 s1(arr); // expected-error {{no matching constructor for initialization of 'std::span'}} - } - -// Type wrong - { - std::span s1(arr); // expected-error {{no matching constructor for initialization of 'std::span'}} - std::span s2(arr); // expected-error {{no matching constructor for initialization of 'std::span'}} - } - -// CV wrong (dynamically sized) - { - std::span< int> s1{ carr}; // expected-error {{no matching constructor for initialization of 'std::span'}} - std::span< int> s2{ varr}; // expected-error {{no matching constructor for initialization of 'std::span'}} - std::span< int> s3{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span'}} - std::span s4{ varr}; // expected-error {{no matching constructor for initialization of 'std::span'}} - std::span s5{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span'}} - std::span< volatile int> s6{ carr}; // expected-error {{no matching constructor for initialization of 'std::span'}} - std::span< volatile int> s7{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span'}} - } - -// CV wrong (statically sized) - { - std::span< int,3> s1{ carr}; // expected-error {{no matching constructor for initialization of 'std::span'}} - std::span< int,3> s2{ varr}; // expected-error {{no matching constructor for initialization of 'std::span'}} - std::span< int,3> s3{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span'}} - std::span s4{ varr}; // expected-error {{no matching constructor for initialization of 'std::span'}} - std::span s5{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span'}} - std::span< volatile int,3> s6{ carr}; // expected-error {{no matching constructor for initialization of 'std::span'}} - std::span< volatile int,3> s7{cvarr}; // expected-error {{no matching constructor for initialization of 'std::span'}} - } - - 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 --- 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 @@ -117,5 +117,42 @@ checkCV(); + // Size wrong + { + static_assert(!std::is_constructible, int (&)[3]>::value, ""); + } + + // Type wrong + { + static_assert(!std::is_constructible, int (&)[3]>::value, ""); + static_assert(!std::is_constructible, int (&)[3]>::value, ""); + } + + // CV wrong (dynamically sized) + { + static_assert(!std::is_constructible, const int (&)[3]>::value, ""); + static_assert(!std::is_constructible, volatile int (&)[3]>::value, ""); + static_assert(!std::is_constructible, const volatile int (&)[3]>::value, ""); + + static_assert(!std::is_constructible, volatile int (&)[3]>::value, ""); + static_assert(!std::is_constructible, const volatile int (&)[3]>::value, ""); + + static_assert(!std::is_constructible, const int (&)[3]>::value, ""); + static_assert(!std::is_constructible, const volatile int (&)[3]>::value, ""); + } + + // CV wrong (statically sized) + { + static_assert(!std::is_constructible, const int (&)[3]>::value, ""); + static_assert(!std::is_constructible, volatile int (&)[3]>::value, ""); + static_assert(!std::is_constructible, const volatile int (&)[3]>::value, ""); + + static_assert(!std::is_constructible, volatile int (&)[3]>::value, ""); + static_assert(!std::is_constructible, const volatile int (&)[3]>::value, ""); + + static_assert(!std::is_constructible, const int (&)[3]>::value, ""); + static_assert(!std::is_constructible, 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 --- 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 - -// - -// constexpr span() noexcept; -// -// Remarks: This constructor shall not participate in overload resolution -// unless Extent == 0 || Extent == dynamic_extent is true. - - -#include -#include -#include - -#include "test_macros.h" - -int main(int, char**) -{ - std::span s; // expected-error {{no matching constructor for initialization of 'std::span'}} - - 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 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 --- 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 - 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 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 --- 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 - 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 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 --- 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 - 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 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 --- 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 + // // A program that necessitates the instantiation of template optional for @@ -14,14 +15,7 @@ #include -int main(int, char**) -{ - using std::optional; - using std::in_place_t; - using std::in_place; - - optional opt; // expected-note {{requested here}} +void f() { + std::optional opt; // expected-note {{requested here}} // expected-error@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 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 --- 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 + // // A program that necessitates the instantiation of template optional for @@ -14,17 +15,10 @@ #include -int main(int, char**) -{ - using std::optional; - using std::nullopt_t; - using std::nullopt; - - optional opt; // expected-note 1 {{requested here}} - optional opt1; // expected-note 1 {{requested here}} - optional opt2; // expected-note 1 {{requested here}} - optional opt3; // expected-note 1 {{requested here}} +void f() { + std::optional opt; // expected-note 1 {{requested here}} + std::optional opt1; // expected-note 1 {{requested here}} + std::optional opt2; // expected-note 1 {{requested here}} + std::optional opt3; // expected-note 1 {{requested here}} // expected-error@optional:* 4 {{instantiation of optional with nullopt_t is ill-formed}} - - 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 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 --- 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 -#include -int main(int, char**) -{ - using T = std::tuple; - 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; +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 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 --- 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 -int main(int, char**) -{ +void f() { (void)std::tuple_size &>::value; // expected-error {{implicit instantiation of undefined template}} (void)std::tuple_size::value; // expected-error {{implicit instantiation of undefined template}} (void)std::tuple_size*>::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 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 --- 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 @@ template <> struct std::tuple_size {}; -int main(int, char**) -{ +void f() { // Test that tuple_size is not incomplete when tuple_size::value // is well-formed but not a constant expression. { @@ -59,6 +58,4 @@ // expected-error@*:* 1 {{no member named 'value'}} (void)std::tuple_size::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 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 --- 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 -int main(int, char**) -{ +void f() { (void)std::tuple_size_v &>; // expected-note {{requested here}} (void)std::tuple_size_v; // expected-note {{requested here}} (void)std::tuple_size_v*>; // expected-note {{requested here}} // expected-error@tuple:* 3 {{implicit instantiation of undefined template}} - - 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 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 --- 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 @@ std::tuple explicit_default_test() { return {std::allocator_arg, std::allocator()}; // 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 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 --- 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 @@ return {std::allocator_arg, std::allocator{}, e}; // expected-error@-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 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 --- 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 @@ return {std::allocator_arg, std::allocator{}, t1}; // 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.cnstr/alloc_convert_move.fail.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/alloc_convert_move.verify.cpp 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 --- 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 @@ return {std::allocator_arg, std::allocator{}, std::move(t1)}; // 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.cnstr/const_Types.fail.cpp b/libcxx/test/std/utilities/tuple/tuple.tuple/tuple.cnstr/const_Types.verify.cpp 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 --- 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 @@ return e; // expected-error@-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 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 --- 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 test13() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}} std::tuple test14() { return {}; } // expected-error 1 {{chosen constructor is explicit in copy-initialization}} std::tuple 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 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 --- 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 @@ std::tuple 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 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 --- 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 @@ upint p = std::get(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/utility/pairs/pair.piecewise/piecewise_construct_t.verify.cpp b/libcxx/test/std/utilities/utility/pairs/pair.piecewise/piecewise_construct_t.verify.cpp --- 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 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 --- 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